Skip to content

Commit

Permalink
[CI] download server on module checks
Browse files Browse the repository at this point in the history
[TEST] simplified tests
  • Loading branch information
aricart committed Jul 2, 2024
1 parent c139b0d commit d6e90a5
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 21 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ jobs:
with:
deno-version: ${{ matrix.deno-version }}

- name: Set NATS Server Version
run: echo "NATS_VERSION=v2.10.17" >> $GITHUB_ENV

- name: Get nats-server
run: |
wget "https://github.com/nats-io/nats-server/releases/download/$NATS_VERSION/nats-server-$NATS_VERSION-linux-amd64.zip" -O tmp.zip
unzip tmp.zip
mv nats-server-$NATS_VERSION-linux-amd64 nats-server
rm nats-server/README.md LICENSE
- name: Lint Deno Module
working-directory: core
run: |
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/jetstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ jobs:
with:
deno-version: ${{ matrix.deno-version }}

- name: Set NATS Server Version
run: echo "NATS_VERSION=v2.10.17" >> $GITHUB_ENV

- name: Get nats-server
run: |
wget "https://github.com/nats-io/nats-server/releases/download/$NATS_VERSION/nats-server-$NATS_VERSION-linux-amd64.zip" -O tmp.zip
unzip tmp.zip
mv nats-server-$NATS_VERSION-linux-amd64 nats-server
rm nats-server/README.md LICENSE
- name: Lint Deno Module
working-directory: jetstream
run: |
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/kv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ jobs:
with:
deno-version: ${{ matrix.deno-version }}

- name: Set NATS Server Version
run: echo "NATS_VERSION=v2.10.17" >> $GITHUB_ENV

- name: Get nats-server
run: |
wget "https://github.com/nats-io/nats-server/releases/download/$NATS_VERSION/nats-server-$NATS_VERSION-linux-amd64.zip" -O tmp.zip
unzip tmp.zip
mv nats-server-$NATS_VERSION-linux-amd64 nats-server
rm nats-server/README.md LICENSE
- name: Lint Deno Module
working-directory: kv
run: |
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/obj.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ jobs:
with:
deno-version: ${{ matrix.deno-version }}

- name: Set NATS Server Version
run: echo "NATS_VERSION=v2.10.17" >> $GITHUB_ENV

- name: Get nats-server
run: |
wget "https://github.com/nats-io/nats-server/releases/download/$NATS_VERSION/nats-server-$NATS_VERSION-linux-amd64.zip" -O tmp.zip
unzip tmp.zip
mv nats-server-$NATS_VERSION-linux-amd64 nats-server
rm nats-server/README.md LICENSE
- name: Lint Deno Module
working-directory: obj
run: |
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ jobs:
with:
deno-version: ${{ matrix.deno-version }}

- name: Set NATS Server Version
run: echo "NATS_VERSION=v2.10.17" >> $GITHUB_ENV

- name: Get nats-server
run: |
wget "https://github.com/nats-io/nats-server/releases/download/$NATS_VERSION/nats-server-$NATS_VERSION-linux-amd64.zip" -O tmp.zip
unzip tmp.zip
mv nats-server-$NATS_VERSION-linux-amd64 nats-server
rm nats-server/README.md LICENSE
- name: Lint Deno Module
working-directory: services
run: |
Expand Down
24 changes: 3 additions & 21 deletions core/tests/basics_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -957,17 +957,8 @@ Deno.test("basics - subscription cb with timeout cancels on message", async () =
});

Deno.test("basics - resolve", async () => {
const token = Deno.env.get("NGS_CI_USER");
if (!token) {
disabled(
`skipping: NGS_CI_USER is not available in the environment`,
);
return;
}

const nci = await connect({
servers: "connect.ngs.global",
authenticator: jwtAuthenticator(token),
servers: "demo.nats.io",
}) as NatsConnectionImpl;

await nci.flush();
Expand Down Expand Up @@ -1502,18 +1493,9 @@ Deno.test("basics - respond message", async () => {
await cleanup(ns, nc);
});

Deno.test("basics - resolve", async () => {
const token = Deno.env.get("NGS_CI_USER");
if (token === undefined) {
disabled(
`skipping: NGS_CI_USER is not available in the environment`,
);
return;
}

Deno.test("basics - resolve false", async () => {
const nci = await connect({
servers: "connect.ngs.global",
authenticator: jwtAuthenticator(token),
servers: "demo.nats.io",
resolve: false,
}) as NatsConnectionImpl;

Expand Down

0 comments on commit d6e90a5

Please sign in to comment.