From 7fb3f19df787b8b325f5f20471fc808b4b16ea49 Mon Sep 17 00:00:00 2001 From: qpismont Date: Thu, 4 Jan 2024 23:06:31 +0100 Subject: [PATCH] fix nats unit test connection + fix lint CI job --- .woodpecker/.lint.yml | 5 ++--- .woodpecker/.test.yml | 10 ++++++++-- tests/service.test.ts | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.woodpecker/.lint.yml b/.woodpecker/.lint.yml index 8169fe4..024ce14 100644 --- a/.woodpecker/.lint.yml +++ b/.woodpecker/.lint.yml @@ -1,9 +1,8 @@ -pipeline: +steps: lint: image: denoland/deno:${DENO_VERSION} commands: - - deno ta - - cargo clippy + - deno lint matrix: DENO_VERSION: diff --git a/.woodpecker/.test.yml b/.woodpecker/.test.yml index f355353..b95da98 100644 --- a/.woodpecker/.test.yml +++ b/.woodpecker/.test.yml @@ -1,9 +1,15 @@ -pipeline: +steps: test: image: denoland/deno:${DENO_VERSION} + environment: + - NATS_HOST=nats:4222 commands: - deno task test matrix: DENO_VERSION: - - 1.39.1 \ No newline at end of file + - 1.39.1 + +services: + nats: + image: nats \ No newline at end of file diff --git a/tests/service.test.ts b/tests/service.test.ts index 18d2547..8ffe89d 100644 --- a/tests/service.test.ts +++ b/tests/service.test.ts @@ -7,7 +7,7 @@ import { afterEach, beforeEach, it } from "std/testing/bdd.ts"; let srv!: Service; -const natsServer = "127.0.0.1:4222"; +const natsServer = Deno.env.get("NATS_HOST") || "127.0.0.1:4222"; const serviceName = "test-service"; const adaptorName = "nats"; const subject = "test";