Skip to content

Commit

Permalink
Merge branch 'fix_gh_action'
Browse files Browse the repository at this point in the history
  • Loading branch information
oleiade committed Sep 6, 2024
2 parents fbe41eb + 5bbe113 commit 5e091ef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 10 additions & 2 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -96,4 +104,4 @@ export default async function testSuite() {
await kinesisTestSuite(testData)
await eventBridgeTestSuite(testData)
await lambdaTestSuite(testData)
}
}

0 comments on commit 5e091ef

Please sign in to comment.