From e6fd54e4286ed969482d298f9539c226d9c535d2 Mon Sep 17 00:00:00 2001 From: Przemyslaw Motacki Date: Tue, 4 Mar 2025 17:20:23 +0100 Subject: [PATCH] SNOW-1883649 - wiremock integration --- .github/workflows/build-test.yml | 5 +++++ ci/_init.sh | 2 +- ci/image/Dockerfile | 4 +++- ci/test_authentication.sh | 2 +- test/wiremockRunner.js | 5 +++-- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 67b31a63c..c6a6058d7 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -90,6 +90,11 @@ jobs: nodeVersion: ['18.x', '20.x', '22.x'] steps: - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + java-package: 'jre' - uses: actions/setup-node@v4 with: node-version: ${{ matrix.nodeVersion }} diff --git a/ci/_init.sh b/ci/_init.sh index 9f5584b51..8a1672fa6 100755 --- a/ci/_init.sh +++ b/ci/_init.sh @@ -18,7 +18,7 @@ export DRIVER_NAME=nodejs BUILD_IMAGE_VERSION=1 # Test Images -TEST_IMAGE_VERSION=1 +TEST_IMAGE_VERSION=2 declare -A BUILD_IMAGE_NAMES=( [$DRIVER_NAME-chainguard-node18]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-chainguard-node18-build:$BUILD_IMAGE_VERSION diff --git a/ci/image/Dockerfile b/ci/image/Dockerfile index 8c7574950..01d6a4b59 100644 --- a/ci/image/Dockerfile +++ b/ci/image/Dockerfile @@ -3,9 +3,11 @@ FROM $IMAGE USER root -RUN apk update && apk add python3 jq aws-cli gosu +RUN apk update && apk add python3 python3-dev py3-pip jq aws-cli gosu openjdk-17 RUN pip install -U snowflake-connector-python +ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk + # workspace RUN mkdir -p /home/user && \ chmod 777 /home/user diff --git a/ci/test_authentication.sh b/ci/test_authentication.sh index c6545ad47..83406daa8 100755 --- a/ci/test_authentication.sh +++ b/ci/test_authentication.sh @@ -13,5 +13,5 @@ docker run \ -v $(cd $THIS_DIR/.. && pwd):/mnt/host \ -v $WORKSPACE:/mnt/workspace \ --rm \ - nexus.int.snowflakecomputing.com:8086/docker/snowdrivers-test-external-browser:3 \ + nexus.int.snowflakecomputing.com:8086/docker/snowdrivers-test-external-browser:7 \ "/mnt/host/ci/container/test_authentication.sh" \ No newline at end of file diff --git a/test/wiremockRunner.js b/test/wiremockRunner.js index 3db88d0dc..298690fcc 100644 --- a/test/wiremockRunner.js +++ b/test/wiremockRunner.js @@ -11,6 +11,7 @@ async function runWireMockAsync(port) { exec(`npx wiremock --enable-browser-proxying --proxy-pass-through false --port ${port} `); const wireMock = new WireMockRestClient(`http://localhost:${port}`, { logLevel: 'debug' }); const readyWireMock = waitForWiremockStarted(wireMock); + console.log("########## WIREMOCK STARTED ##############") resolve(readyWireMock); } catch (err) { reject(err); @@ -19,8 +20,8 @@ async function runWireMockAsync(port) { const timeout = new Promise((resolve, reject) => timeoutHandle = setTimeout( - () => reject('Wiremock unavailable after 60s.'), - 60000)); + () => reject('Wiremock unavailable after 30s.'), + 30000)); return Promise.race([waitingWireMockPromise, timeout]) .then(result => { clearTimeout(timeoutHandle);