From 113bcf515eced12bb7beb539e2d45882e8e51f81 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Sun, 29 Oct 2023 17:23:17 +0100 Subject: [PATCH 01/21] change image to zoeleah/bats --- tests/st2tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index b06a8e06..a82bf2aa 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -2,6 +2,7 @@ version: '3' services: st2test: + platform: linux/amd64 image: ${ST2_IMAGE_REPO:-stackstorm/}st2actionrunner:${ST2_VERSION:-latest} environment: ST2_AUTH_URL: ${ST2_AUTH_URL:-http://st2auth:9100/} @@ -21,7 +22,7 @@ services: depends_on: - st2test-tools st2test-tools: - image: dduportal/bats:latest + image: zoeleah/bats:latest environment: BATS_HELPERS_DIR: /tools/bats-helpers/ BATS_DIR: /tools/bats/ From ab7bca1bef177f2a3253357960c440d66332839a Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Sun, 29 Oct 2023 17:40:36 +0100 Subject: [PATCH 02/21] remove experimental feature --- tests/st2tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index a82bf2aa..33556eb3 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -2,7 +2,6 @@ version: '3' services: st2test: - platform: linux/amd64 image: ${ST2_IMAGE_REPO:-stackstorm/}st2actionrunner:${ST2_VERSION:-latest} environment: ST2_AUTH_URL: ${ST2_AUTH_URL:-http://st2auth:9100/} From e5785e1559b25164607945c31c62d0fce9cc4680 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Sun, 29 Oct 2023 17:51:01 +0100 Subject: [PATCH 03/21] fix URL's for AUTH and STREAM --- tests/st2tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/st2tests.sh b/tests/st2tests.sh index 36386eb3..0c8a32b1 100755 --- a/tests/st2tests.sh +++ b/tests/st2tests.sh @@ -7,13 +7,13 @@ load "${BATS_HELPERS_DIR}/bats-file/load.bash" @test 'st2 version deployed and python env are as expected' { run st2 --version assert_success - # st2 3.7.0, on Python 3.8.10 + # st2 3.8.0, on Python 3.8.10 assert_line --partial "st2 ${ST2_VERSION}" assert_line --partial 'on Python 3.8.10' } @test 'ST2_AUTH_URL service endpoint is accessible and working' { - run curl -v ${ST2_API_URL} + run curl -v ${ST2_AUTH_URL} assert_line --partial 'Content-Type: application/json' assert_line --partial 'St2-Api-Key' } @@ -25,7 +25,7 @@ load "${BATS_HELPERS_DIR}/bats-file/load.bash" } @test 'ST2_STREAM_URL service endpoint is accessible and working' { - run curl -v ${ST2_API_URL} + run curl -v ${ST2_STREAM_URL} assert_line --partial 'Content-Type: application/json' assert_line --partial 'St2-Api-Key' } From 5d2ba269bef442e5290149884bcca7889e266fb5 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Sun, 29 Oct 2023 18:15:39 +0100 Subject: [PATCH 04/21] switch to up --- .github/workflows/st2-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/st2-docker.yml b/.github/workflows/st2-docker.yml index e1dbee5c..bca1b2c5 100644 --- a/.github/workflows/st2-docker.yml +++ b/.github/workflows/st2-docker.yml @@ -39,7 +39,7 @@ jobs: - name: Run st2 smoke-tests run: | - docker-compose --file tests/st2tests.yaml run st2test + docker-compose --file tests/st2tests.yaml up - name: Troubleshooting the build failure if: ${{ failure() }} From 28d1bb5015e85d01f04e4caf6269404658af47d3 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Sun, 29 Oct 2023 18:27:16 +0100 Subject: [PATCH 05/21] switch back --- .github/workflows/st2-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/st2-docker.yml b/.github/workflows/st2-docker.yml index bca1b2c5..e1dbee5c 100644 --- a/.github/workflows/st2-docker.yml +++ b/.github/workflows/st2-docker.yml @@ -39,7 +39,7 @@ jobs: - name: Run st2 smoke-tests run: | - docker-compose --file tests/st2tests.yaml up + docker-compose --file tests/st2tests.yaml run st2test - name: Troubleshooting the build failure if: ${{ failure() }} From d128879e2b4dac230e4ad57e294d258f50b430ba Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Sun, 29 Oct 2023 18:33:14 +0100 Subject: [PATCH 06/21] add changes to CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67cfa18c..bd4108d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2023-10-28 +* Update st2test image to zoeleah/bats:latest +* Fix ST2_AUTH_URL and ST2_STREAM_URL + ## 2022-05-06 * Migrate to Ubuntu 20 / Python 3.8 based containers From 2d9d23ecf0686c9aeac844650dda5d99f6fe8c1c Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 09:41:00 +0100 Subject: [PATCH 07/21] switch to bats/bats like k8s --- tests/st2tests.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index 33556eb3..38eacb15 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -21,11 +21,21 @@ services: depends_on: - st2test-tools st2test-tools: - image: zoeleah/bats:latest + image: bats/bats:latest environment: BATS_HELPERS_DIR: /tools/bats-helpers/ BATS_DIR: /tools/bats/ - command: /st2tests.sh + command: + - bash + - -ec + - | + git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \ + https://github.com/ztombol/bats-assert /tools/bats-helpers/bats-assert + git clone --config advice.detachedHead=false --depth 1 --branch v0.2.0 \ + https://github.com/ztombol/bats-file /tools/bats-helpers/bats-file + git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \ + https://github.com/ztombol/bats-support /tools/bats-helpers/bats-support + /st2tests.sh volumes: - tools:/tools - ./st2tests-tools.sh:/st2tests.sh:ro From 59bbac8aa818154410b5a8dbb42957fef7946adb Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 09:41:44 +0100 Subject: [PATCH 08/21] change changelog description --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd4108d9..96162e9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog ## 2023-10-28 -* Update st2test image to zoeleah/bats:latest +* Update st2test image to bats/bats:latest * Fix ST2_AUTH_URL and ST2_STREAM_URL ## 2022-05-06 From 79d6f584b00470e3c894b413860d13498a34b531 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 10:02:55 +0100 Subject: [PATCH 09/21] add st2test-bats --- tests/st2tests.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index 38eacb15..6ff794cf 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -21,7 +21,7 @@ services: depends_on: - st2test-tools st2test-tools: - image: bats/bats:latest + image: alpine/git:latest environment: BATS_HELPERS_DIR: /tools/bats-helpers/ BATS_DIR: /tools/bats/ @@ -39,6 +39,17 @@ services: volumes: - tools:/tools - ./st2tests-tools.sh:/st2tests.sh:ro + depends_on: + - st2test-bats + st2test-bats: + image: bats/bats:latest + command: + - bash + - -ec + - | + cp -R /opt/bats /tools/ + volumes: + - tools:/tools volumes: tools: From 92164c6fbf8289fa08f8dcd814e8a30bd1d8e8c0 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 10:13:37 +0100 Subject: [PATCH 10/21] switch to /usr/sbin/bats and remove st2test-bats --- tests/st2tests.yaml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index 6ff794cf..475c9323 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -11,7 +11,7 @@ services: BATS_HELPERS_DIR: /tools/bats-helpers/ ST2_AUTH_USERNAME: ${ST2_AUTH_USERNAME:-st2admin} ST2_AUTH_PASSWORD: ${ST2_AUTH_PASSWORD:-Ch@ngeMe} - command: bash -c "ln -s /tools/bats/libexec/bats /sbin/bats && /st2tests.sh" + command: bash -c "ln -s /tools/bats/libexec/bats /usr/sbin/bats && /st2tests.sh" volumes: - ./st2tests.sh:/st2tests.sh:ro - tools:/tools @@ -21,7 +21,7 @@ services: depends_on: - st2test-tools st2test-tools: - image: alpine/git:latest + image: bats/bats:latest environment: BATS_HELPERS_DIR: /tools/bats-helpers/ BATS_DIR: /tools/bats/ @@ -39,17 +39,6 @@ services: volumes: - tools:/tools - ./st2tests-tools.sh:/st2tests.sh:ro - depends_on: - - st2test-bats - st2test-bats: - image: bats/bats:latest - command: - - bash - - -ec - - | - cp -R /opt/bats /tools/ - volumes: - - tools:/tools volumes: tools: From 74da87e8365a4c566a270e39e2ccb06beb55c6ad Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 10:43:41 +0100 Subject: [PATCH 11/21] add PATH --- tests/st2tests.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index 475c9323..562bcc8c 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -11,7 +11,8 @@ services: BATS_HELPERS_DIR: /tools/bats-helpers/ ST2_AUTH_USERNAME: ${ST2_AUTH_USERNAME:-st2admin} ST2_AUTH_PASSWORD: ${ST2_AUTH_PASSWORD:-Ch@ngeMe} - command: bash -c "ln -s /tools/bats/libexec/bats /usr/sbin/bats && /st2tests.sh" + PATH: "/tools/bats/libexec/:$PATH" + command: bash -c "/st2tests.sh" volumes: - ./st2tests.sh:/st2tests.sh:ro - tools:/tools @@ -26,15 +27,16 @@ services: BATS_HELPERS_DIR: /tools/bats-helpers/ BATS_DIR: /tools/bats/ command: - - bash + - ash - -ec - | + cp -R /opt/bats /tools/ git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \ - https://github.com/ztombol/bats-assert /tools/bats-helpers/bats-assert + https://github.com/ztombol/bats-assert /tools/bats-assert git clone --config advice.detachedHead=false --depth 1 --branch v0.2.0 \ - https://github.com/ztombol/bats-file /tools/bats-helpers/bats-file + https://github.com/ztombol/bats-file /tools/bats-file git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \ - https://github.com/ztombol/bats-support /tools/bats-helpers/bats-support + https://github.com/ztombol/bats-support /tools/bats-support /st2tests.sh volumes: - tools:/tools @@ -45,4 +47,4 @@ volumes: networks: st2-docker_private: - external: true + external: true \ No newline at end of file From 9026c368c2177d63586dd375272f7680566caab9 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 11:12:46 +0100 Subject: [PATCH 12/21] another attempt to get bats into the ENV --- tests/st2tests.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index 562bcc8c..193a334c 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -11,8 +11,7 @@ services: BATS_HELPERS_DIR: /tools/bats-helpers/ ST2_AUTH_USERNAME: ${ST2_AUTH_USERNAME:-st2admin} ST2_AUTH_PASSWORD: ${ST2_AUTH_PASSWORD:-Ch@ngeMe} - PATH: "/tools/bats/libexec/:$PATH" - command: bash -c "/st2tests.sh" + command: bash -c "export PATH=/tools/bats/libexec/:${PATh}" >> /root/.bashrc && /st2tests.sh" volumes: - ./st2tests.sh:/st2tests.sh:ro - tools:/tools From 41be5af188a80f1b393f5d090570d38494f87c8d Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 11:17:00 +0100 Subject: [PATCH 13/21] fix typo and remove closing quotation --- tests/st2tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index 193a334c..7551da1b 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -11,7 +11,7 @@ services: BATS_HELPERS_DIR: /tools/bats-helpers/ ST2_AUTH_USERNAME: ${ST2_AUTH_USERNAME:-st2admin} ST2_AUTH_PASSWORD: ${ST2_AUTH_PASSWORD:-Ch@ngeMe} - command: bash -c "export PATH=/tools/bats/libexec/:${PATh}" >> /root/.bashrc && /st2tests.sh" + command: bash -c "export PATH=/tools/bats/libexec/:${PATH} >> /root/.bashrc && /st2tests.sh" volumes: - ./st2tests.sh:/st2tests.sh:ro - tools:/tools From 4bf956c804f7dfed6ae3b4eb84f6d71c884b02f4 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 11:27:03 +0100 Subject: [PATCH 14/21] add /tools/bats/libexec/bats to st2test.sh --- tests/st2tests.sh | 2 +- tests/st2tests.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/st2tests.sh b/tests/st2tests.sh index 0c8a32b1..78a5d41a 100755 --- a/tests/st2tests.sh +++ b/tests/st2tests.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bats +#!/tools/bats/libexec/bats load "${BATS_HELPERS_DIR}/bats-support/load.bash" load "${BATS_HELPERS_DIR}/bats-assert/load.bash" diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index 7551da1b..92562e64 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -11,7 +11,7 @@ services: BATS_HELPERS_DIR: /tools/bats-helpers/ ST2_AUTH_USERNAME: ${ST2_AUTH_USERNAME:-st2admin} ST2_AUTH_PASSWORD: ${ST2_AUTH_PASSWORD:-Ch@ngeMe} - command: bash -c "export PATH=/tools/bats/libexec/:${PATH} >> /root/.bashrc && /st2tests.sh" + command: bash -c "/st2tests.sh" volumes: - ./st2tests.sh:/st2tests.sh:ro - tools:/tools From 3dd3e78ee1d7cb122fe528d348663a6704753edf Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 11:32:15 +0100 Subject: [PATCH 15/21] add "du /tools" to find the bug --- tests/st2tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index 92562e64..c7c846dd 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -11,7 +11,7 @@ services: BATS_HELPERS_DIR: /tools/bats-helpers/ ST2_AUTH_USERNAME: ${ST2_AUTH_USERNAME:-st2admin} ST2_AUTH_PASSWORD: ${ST2_AUTH_PASSWORD:-Ch@ngeMe} - command: bash -c "/st2tests.sh" + command: bash -c "du /tools/ && /st2tests.sh" volumes: - ./st2tests.sh:/st2tests.sh:ro - tools:/tools @@ -26,7 +26,7 @@ services: BATS_HELPERS_DIR: /tools/bats-helpers/ BATS_DIR: /tools/bats/ command: - - ash + - bash - -ec - | cp -R /opt/bats /tools/ From 3fed9ba86f0789529147976e46ffd9ad38537f65 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 11:43:57 +0100 Subject: [PATCH 16/21] debug --- tests/st2tests.sh | 2 +- tests/st2tests.yaml | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/st2tests.sh b/tests/st2tests.sh index 78a5d41a..0c8a32b1 100755 --- a/tests/st2tests.sh +++ b/tests/st2tests.sh @@ -1,4 +1,4 @@ -#!/tools/bats/libexec/bats +#!/usr/bin/env bats load "${BATS_HELPERS_DIR}/bats-support/load.bash" load "${BATS_HELPERS_DIR}/bats-assert/load.bash" diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index c7c846dd..28cd34a6 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -8,7 +8,7 @@ services: ST2_API_URL: ${ST2_API_URL:-http://st2api:9101/} ST2_STREAM_URL: ${ST2_STREAM_URL:-http://st2stream:9102/} ST2WEB_HTTPS: ${ST2WEB_HTTPS:-0} - BATS_HELPERS_DIR: /tools/bats-helpers/ + BATS_HELPERS_DIR: /tools/ ST2_AUTH_USERNAME: ${ST2_AUTH_USERNAME:-st2admin} ST2_AUTH_PASSWORD: ${ST2_AUTH_PASSWORD:-Ch@ngeMe} command: bash -c "du /tools/ && /st2tests.sh" @@ -21,25 +21,31 @@ services: depends_on: - st2test-tools st2test-tools: - image: bats/bats:latest - environment: - BATS_HELPERS_DIR: /tools/bats-helpers/ - BATS_DIR: /tools/bats/ + image: alpine/git:latest command: - - bash + - ash - -ec - | - cp -R /opt/bats /tools/ git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \ https://github.com/ztombol/bats-assert /tools/bats-assert git clone --config advice.detachedHead=false --depth 1 --branch v0.2.0 \ https://github.com/ztombol/bats-file /tools/bats-file git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \ https://github.com/ztombol/bats-support /tools/bats-support - /st2tests.sh volumes: - tools:/tools - ./st2tests-tools.sh:/st2tests.sh:ro + depends_on: + - st2test-bats + st2test-bats: + image: bats/bats:latest + command: + - bash + - -ec + - | + cp -R /opt/bats /tools/ + volumes: + - tools:/tools volumes: tools: From cefd22648804bbd4d5db8599270cc6ab40db489d Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 11:47:16 +0100 Subject: [PATCH 17/21] debug --- tests/st2tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index 28cd34a6..56bd6317 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -11,7 +11,7 @@ services: BATS_HELPERS_DIR: /tools/ ST2_AUTH_USERNAME: ${ST2_AUTH_USERNAME:-st2admin} ST2_AUTH_PASSWORD: ${ST2_AUTH_PASSWORD:-Ch@ngeMe} - command: bash -c "du /tools/ && /st2tests.sh" + command: bash -c "ls -lah /tools/ && /st2tests.sh" volumes: - ./st2tests.sh:/st2tests.sh:ro - tools:/tools From 8575f31ff81d140858795054c4630b0b1fa4512c Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 19:47:28 +0100 Subject: [PATCH 18/21] rename file and remove variable --- tests/st2tests-tools.sh | 5 ----- tests/{st2tests.sh => st2tests.bat} | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 tests/st2tests-tools.sh rename tests/{st2tests.sh => st2tests.bat} (93%) diff --git a/tests/st2tests-tools.sh b/tests/st2tests-tools.sh deleted file mode 100644 index aa96d2ce..00000000 --- a/tests/st2tests-tools.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -mkdir -p ${BATS_HELPERS_DIR} ${BATS_DIR} -cp -R /opt/bats/* ${BATS_DIR} -cp -R /opt/bats-helpers/* ${BATS_HELPERS_DIR} diff --git a/tests/st2tests.sh b/tests/st2tests.bat similarity index 93% rename from tests/st2tests.sh rename to tests/st2tests.bat index 0c8a32b1..495d9c17 100755 --- a/tests/st2tests.sh +++ b/tests/st2tests.bat @@ -1,8 +1,8 @@ -#!/usr/bin/env bats +# bats smoke-tests -load "${BATS_HELPERS_DIR}/bats-support/load.bash" -load "${BATS_HELPERS_DIR}/bats-assert/load.bash" -load "${BATS_HELPERS_DIR}/bats-file/load.bash" +load "/tools/bats-support/load.bash" +load "/tools/bats-assert/load.bash" +load "/tools/bats-file/load.bash" @test 'st2 version deployed and python env are as expected' { run st2 --version From 93f8c94536104baacdfc1ffd276115b26abc3271 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 19:47:43 +0100 Subject: [PATCH 19/21] add bats installation --- tests/st2tests.yaml | 48 +++++++++++++-------------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index 56bd6317..d3e79e61 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -6,50 +6,30 @@ services: environment: ST2_AUTH_URL: ${ST2_AUTH_URL:-http://st2auth:9100/} ST2_API_URL: ${ST2_API_URL:-http://st2api:9101/} - ST2_STREAM_URL: ${ST2_STREAM_URL:-http://st2stream:9102/} + ST2_STREAM_URL: ${ST2_STREAM_URL:-http://st2stream:9102/}- ST2WEB_HTTPS: ${ST2WEB_HTTPS:-0} - BATS_HELPERS_DIR: /tools/ ST2_AUTH_USERNAME: ${ST2_AUTH_USERNAME:-st2admin} ST2_AUTH_PASSWORD: ${ST2_AUTH_PASSWORD:-Ch@ngeMe} - command: bash -c "ls -lah /tools/ && /st2tests.sh" - volumes: - - ./st2tests.sh:/st2tests.sh:ro - - tools:/tools - networks: - - st2-docker_private - stop_signal: SIGKILL - depends_on: - - st2test-tools - st2test-tools: - image: alpine/git:latest command: - - ash + - bash - -ec - | + apt update > /dev/null 2>&1 + apt install bats -y > /dev/null 2>&1 + mkdir /tools git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \ - https://github.com/ztombol/bats-assert /tools/bats-assert + https://github.com/ztombol/bats-assert /tools/bats-assert > /dev/null 2>&1 git clone --config advice.detachedHead=false --depth 1 --branch v0.2.0 \ - https://github.com/ztombol/bats-file /tools/bats-file + https://github.com/ztombol/bats-file /tools/bats-file > /dev/null 2>&1 git clone --config advice.detachedHead=false --depth 1 --branch v0.3.0 \ - https://github.com/ztombol/bats-support /tools/bats-support - volumes: - - tools:/tools - - ./st2tests-tools.sh:/st2tests.sh:ro - depends_on: - - st2test-bats - st2test-bats: - image: bats/bats:latest - command: - - bash - - -ec - - | - cp -R /opt/bats /tools/ + https://github.com/ztombol/bats-support /tools/bats-support > /dev/null 2>&1 + bats /opt/stackstorm/st2tests.bat volumes: - - tools:/tools - -volumes: - tools: + - ./st2tests.bat:/opt/stackstorm/st2tests.bat:ro + networks: + - st2-docker_private + stop_signal: SIGKILL networks: st2-docker_private: - external: true \ No newline at end of file + external: true From c8f7e46d9a1bb0fc678ea2a38e849fe63d61bb23 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Wed, 1 Nov 2023 20:38:44 +0100 Subject: [PATCH 20/21] add comments to changelog.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96162e9f..9b9f7c6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # Changelog ## 2023-10-28 -* Update st2test image to bats/bats:latest +* Refactor st2test, install BATS via `apt install` +* Remove unneeded file st2test-tools.sh * Fix ST2_AUTH_URL and ST2_STREAM_URL ## 2022-05-06 From 886cacbcfcd9d7e33c2635aa9b50e97e589c30b9 Mon Sep 17 00:00:00 2001 From: Ronnie Hoffmann Date: Thu, 2 Nov 2023 19:33:01 +0100 Subject: [PATCH 21/21] Update tests/st2tests.yaml remove dash Co-authored-by: Eugen C. <1533818+armab@users.noreply.github.com> --- tests/st2tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/st2tests.yaml b/tests/st2tests.yaml index d3e79e61..cca86daf 100644 --- a/tests/st2tests.yaml +++ b/tests/st2tests.yaml @@ -6,7 +6,7 @@ services: environment: ST2_AUTH_URL: ${ST2_AUTH_URL:-http://st2auth:9100/} ST2_API_URL: ${ST2_API_URL:-http://st2api:9101/} - ST2_STREAM_URL: ${ST2_STREAM_URL:-http://st2stream:9102/}- + ST2_STREAM_URL: ${ST2_STREAM_URL:-http://st2stream:9102/} ST2WEB_HTTPS: ${ST2WEB_HTTPS:-0} ST2_AUTH_USERNAME: ${ST2_AUTH_USERNAME:-st2admin} ST2_AUTH_PASSWORD: ${ST2_AUTH_PASSWORD:-Ch@ngeMe}