From 5f36c197f65c657a74490e843591195588075ccc Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 22 Oct 2025 12:41:38 +0200 Subject: [PATCH] fix test --- .github/workflows/test_dlt_connector.yml | 10 ++++++++-- dlt-connector/.gitignore | 9 +++++++++ dlt-connector/src/config/schema.ts | 4 ++-- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 dlt-connector/.gitignore diff --git a/.github/workflows/test_dlt_connector.yml b/.github/workflows/test_dlt_connector.yml index da220cba7..4e1b660e8 100644 --- a/.github/workflows/test_dlt_connector.yml +++ b/.github/workflows/test_dlt_connector.yml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v3 - name: Build 'test' image - run: docker build --target test -t "gradido/dlt-connector:test" -f dlt-connector/Dockerfile . + run: docker build --target production -t "gradido/dlt-connector:productionTest" -f dlt-connector/Dockerfile . unit_test: name: Unit Tests - DLT Connector @@ -50,4 +50,10 @@ jobs: run: cd dlt-connector && bun install --frozen-lockfile - name: typecheck && unit test - run: cd dlt-connector && bun typecheck && bun test + run: | + GRADIDO_BLOCKCHAIN_CRYPTO_APP_SECRET=$(openssl rand -hex 16) + GRADIDO_BLOCKCHAIN_SERVER_CRYPTO_KEY=$(openssl rand -hex 16) + HOME_COMMUNITY_SEED=$(openssl rand -hex 32) + HIERO_OPERATOR_KEY=$(openssl rand -hex 32) + HIERO_OPERATOR_ID="0.0.2" + cd dlt-connector && bun typecheck && bun test diff --git a/dlt-connector/.gitignore b/dlt-connector/.gitignore new file mode 100644 index 000000000..5435dd5ff --- /dev/null +++ b/dlt-connector/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/.env +/.env.bak +/build/ +/locales/ +package-json.lock +coverage +# emacs +*~ diff --git a/dlt-connector/src/config/schema.ts b/dlt-connector/src/config/schema.ts index 3dfe3cbe9..6c364a3ef 100644 --- a/dlt-connector/src/config/schema.ts +++ b/dlt-connector/src/config/schema.ts @@ -20,7 +20,7 @@ export const configSchema = v.object({ ), '6010', ), - JWT_SECRET: v.pipe( + JWT_SECRET: v.optional(v.pipe( v.string('The JWT secret for connecting to the backend'), v.custom((input: unknown): boolean => { if (process.env.NODE_ENV === 'production' && input === 'secret123') { @@ -28,7 +28,7 @@ export const configSchema = v.object({ } return true }, "Shouldn't use default value in production"), - ), + ), 'secret123'), GRADIDO_BLOCKCHAIN_CRYPTO_APP_SECRET: hexSchema, GRADIDO_BLOCKCHAIN_SERVER_CRYPTO_KEY: hex16Schema, HOME_COMMUNITY_SEED: v.pipe(