Skip to content

Commit

Permalink
chore(justfile): add system test shortcut command (#1825)
Browse files Browse the repository at this point in the history
<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
NathanFlurry committed Jan 13, 2025
1 parent 5c599c6 commit 1ce6f44
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/system-test/ws_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const RIVET_SERVICE_TOKEN = Deno.env.get("RIVET_SERVICE_TOKEN");
const RIVET_PROJECT = Deno.env.get("RIVET_PROJECT");
const RIVET_ENVIRONMENT = Deno.env.get("RIVET_ENVIRONMENT");

let region = Deno.env.get("REGION");
if (!region || region.length == 0) {
region = undefined;
}

const client = new RivetClient({
environment: RIVET_ENDPOINT,
token: RIVET_SERVICE_TOKEN,
Expand All @@ -15,11 +20,13 @@ const client = new RivetClient({
async function run() {
let actorId: string | undefined;
try {
console.log("Creating actor");

console.log("Creating actor", { region });
const { actor } = await client.actor.create({
project: RIVET_PROJECT,
environment: RIVET_ENVIRONMENT,
body: {
region,
tags: {
name: "ws",
},
Expand Down
8 changes: 8 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ actor-compile-bridge:
actor-check: actor-compile-bridge
cd sdks/actor && deno check --all client/**/*.ts runtime/**/*.ts client/**/*.ts manager/**/*.ts && biome check --write

[group('system')]
system-test REGION="":
cd examples/system-test && REGION={{REGION}} rivet deno --populate-env run -A ws_test.ts

[group('system')]
system-test-login:
cd examples/system-test && rivet login

alias gcs := graphite-create-submit

[group('graphite')]
Expand Down

0 comments on commit 1ce6f44

Please sign in to comment.