Skip to content

Commit

Permalink
Migrate from postman to bruno for integration tests (#2197)
Browse files Browse the repository at this point in the history
* Initial bruno test commit

* Added set cookie pre request scripts for the rest of the tests that require them

* Fixed List Attachments for Datarecord test

* Added OpenID Connect tests

* Added docker compose to run bruno tests. Fixed up configuration to work with bruno method of running CLI tool

* Added config to run bruno tests on CircleCI

* Tidied up writing of test report

* Removed Solr test as it should really be done as part of the Mocha tests

* Added npm install command required to get mocha inside node_modules.

* Added missing tests from current develop branch postman

* Ported final tests from postman to bruno

* Updated mocha tests to use latest mongo image

* Fixed mongodb docker label

* run bruno and remove postman

Signed-off-by: Mark Cottman-Fields <[email protected]>

* run bruno and remove postman

Signed-off-by: Mark Cottman-Fields <[email protected]>

* ensure junit output dirs are available

Signed-off-by: Mark Cottman-Fields <[email protected]>

* reuse npm run instead of duplicate docker compose command

Signed-off-by: Mark Cottman-Fields <[email protected]>

* make .tmp folders consistently created in top-level dir

Signed-off-by: Mark Cottman-Fields <[email protected]>

---------

Signed-off-by: Mark Cottman-Fields <[email protected]>
Co-authored-by: Andrew Brazzatti <[email protected]>
Co-authored-by: andrewbrazzatti <[email protected]>
  • Loading branch information
3 people authored May 27, 2024
1 parent 65506c0 commit 3f079d0
Show file tree
Hide file tree
Showing 120 changed files with 8,575 additions and 8,736 deletions.
20 changes: 11 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,29 +78,31 @@ jobs:
command: |
mkdir -p /tmp/.codecov-cli
cd /tmp/.codecov-cli
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://cli.codecov.io/latest/linux/codecov
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
- run:
name: Run Postman and Mocha tests with code coverage
name: Run Bruno and Mocha tests with code coverage
command: |
sudo mkdir -p .tmp/junit
sudo chmod -R 777 .
cd support/integration-testing
sudo mkdir -p .tmp/junit/backend-bruno
sudo mkdir -p .tmp/junit/backend-mocha
sudo mkdir -p .tmp/attachments/staging
sudo chmod -R 777 .
docker-compose -f docker-compose.newman.yml up --abort-on-container-exit --exit-code-from redboxportal
docker-compose -f docker-compose.mocha.yml up --abort-on-container-exit --exit-code-from redboxportal
cd support/integration-testing
npm run test:bruno
npm run test:bruno:clean
npm run test:mocha
npm run test:mocha:clean
- run:
name: Upload newman and mocha code coverage
name: Upload Bruno and mocha code coverage
command: |
/tmp/.codecov-cli/codecov --verbose upload-process --fail-on-error --disable-search \
--token "${CODECOV_TOKEN}" --name "job-${CIRCLE_BUILD_NUM}-${CIRCLE_BRANCH}" \
--flag "backend-newman" --file "./coverage/newman/lcov.info"
--flag "backend-bruno" --file "./coverage/bruno/lcov.info"
/tmp/.codecov-cli/codecov --verbose upload-process --fail-on-error --disable-search \
--token "${CODECOV_TOKEN}" --name "job-${CIRCLE_BUILD_NUM}-${CIRCLE_BRANCH}" \
--flag "backend-mocha" --file "./coverage/mocha/lcov.info"
Expand Down
8 changes: 4 additions & 4 deletions config/env/integrationtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
log: {
level: 'verbose'
},
appUrl:'http://localhost:1500',
appUrl:'http://redboxportal:1500',
record:{
baseUrl: {
redbox: "http://redbox:9000/redbox",
Expand Down Expand Up @@ -67,7 +67,7 @@ module.exports = {
secretOrKey: 'Y30wY4xv1*6I7yUX%6v*Tzce8OEbVO&@R4hVb%2@Gehtx^xgOqQ97Slv!ZOkfHHmox&x0zAt*0o&4^8$9oW8WTf&r@&d31EFbQZr',
jsonWebTokenOptions: {
issuer: 'https://rapid.test.aaf.edu.au',
audience: 'http://localhost:1500/default/rdmp/',
audience: 'http://redboxportal:1500/default/rdmp/',
ignoreNotBefore: true
}
}
Expand Down Expand Up @@ -95,8 +95,8 @@ module.exports = {
client: {
client_id: 'redbox',
client_secret: 'w2snramgGaqehPiujV695iUfKmZAJ147',
redirect_uris: ['http://localhost:1500/user/login_oidc'],
post_logout_redirect_uris: ['http://localhost:1500/default/rdmp/user/logout'],
redirect_uris: ['http://redboxportal:1500/user/login_oidc'],
post_logout_redirect_uris: ['http://redboxportal:1500/default/rdmp/user/logout'],
},
params: {
scope: 'openid email profile',
Expand Down
Loading

0 comments on commit 3f079d0

Please sign in to comment.