diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 2ebb49e..a528c7d 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -23,16 +23,19 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.x + go-version: 1.22.x - name: Install k6 run: go install go.k6.io/k6@latest - - name: Build the stack - run: docker-compose up -d + - name: Build the docker-compose stack + uses: hoverkraft-tech/compose-action@v2.0.1 + with: + up-flags: "-d" + down-flags: "-v" - name: Wait for the localstack scripts to have been applied run: sleep 30 - name: Test - run: npm run ci-test + run: npm run test:ci diff --git a/package.json b/package.json index ead91e7..e013789 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,9 @@ "engines": {}, "scripts": { "webpack": "./node_modules/.bin/webpack", - "test": "npm run webpack && docker-compose down && docker-compose up --build -d && sleep 15 && k6 run tests/index.js", - "lint": "npx eslint src tests examples", - "ci-test": "npm run webpack && k6 run tests/index.js" + "test": "npm run webpack && docker-compose down -v && docker-compose up --build -d && sleep 15 && k6 run -q tests/index.js", + "test:ci": "npm run webpack && k6 run -q tests/index.js", + "lint": "npx eslint src tests examples" }, "keywords": [ "k6", diff --git a/tests/index.js b/tests/index.js index 7ea2685..91c95d1 100644 --- a/tests/index.js +++ b/tests/index.js @@ -86,7 +86,15 @@ const testData = { }, } -export default async function testSuite() { +export const options = { + thresholds: { + // As we're essentially unit testing here, we want to make sure that + // the rate of successful checks is 100% + checks: ['rate>=1'], + } +} + +export default async function() { signatureV4TestSuite() await s3TestSuite(testData) await secretsManagerTestSuite(testData) @@ -96,4 +104,4 @@ export default async function testSuite() { await kinesisTestSuite(testData) await eventBridgeTestSuite(testData) await lambdaTestSuite(testData) -} +} \ No newline at end of file