Skip to content

Commit

Permalink
Adjust nodejs integration tests and ci
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
  • Loading branch information
Patrik-Stas committed Oct 7, 2020
1 parent 21bd0e1 commit a195be4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -665,31 +665,31 @@ jobs:
docker run --rm -d --name postgres --network host -e POSTGRES_PASSWORD=mysecretpassword postgres:12.1
docker run --rm -d --name vcxagency --network host --env-file ci/agency/localhost.env $DOCKER_IMG_NAME_AGENCY
- name: Run wrapper integration test
- name: Run wrapper legacy integration test
run: |
set -x
docker run --rm -i --name libvcx --network host -e NPMJS_TOKEN=$NPMJS_TOKEN $DOCKER_IMG_NAME_LIBVCX \
bash -c '(
cd $HOME/wrappers/node && npm install && npm run compile && \
cd $HOME/agents/node/vcxagent-core && npm install && npm run test:integration)'
cd $HOME/agents/node/vcxagent-core && npm install && npm run test:legacy:integration)'
- name: Run wrapper integration revocation test
- name: Run wrapper legacy integration revocation test
run: |
set -x
docker run --rm -i --name libvcx --network host -e NPMJS_TOKEN=$NPMJS_TOKEN $DOCKER_IMG_NAME_LIBVCX \
bash -c '(
cd $HOME/wrappers/node && npm install && npm run compile && \
cd $HOME/agents/node/vcxagent-core && npm install && npm run test:integration:revocation)'
cd $HOME/agents/node/vcxagent-core && npm install && npm run test:legacy:integration:revocation)'
- name: Run wrapper api v2 integration test
- name: Run integration tests
run: |
set -x
docker run --rm -i --name libvcx --network host -e NPMJS_TOKEN=$NPMJS_TOKEN $DOCKER_IMG_NAME_LIBVCX \
bash -c '(
cd $HOME/wrappers/node && npm install && npm run compile && \
cd $HOME/agents/node/vcxagent-core && npm install && \
cd $HOME/agents/node/vcxagent-cli && npm install && \
cd $HOME/agents/node/vcxagent-core && npm run test:update-state)'
cd $HOME/agents/node/vcxagent-core && npm run test:integration)'
# TODO: Add tests of iOS build
publish-ios-wrapper:
Expand Down
9 changes: 5 additions & 4 deletions agents/node/vcxagent-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
"demo:faber:pg": "node demo/faber.js --postgresql",
"demo:alice:sign": "node demo/alice-signature.js",
"demo:faber:verify": "node demo/faber-verify-signature.js",
"test:integration": "node demo/integration-test.js",
"test:integration:revocation": "REVOCATION=true node demo/integration-test.js",
"test:update-state": "jest --forceExit --env=node --runInBand test/update-state-v2.spec.js",
"test:signing": "jest --forceExit --env=node --runInBand test/sign-verify.spec.js"
"test:legacy:integration": "node demo/integration-test.js",
"test:legacy:integration:revocation": "REVOCATION=true node demo/integration-test.js",
"test:integration": "npm run test:integration:update-state && npm run test:integration:signing",
"test:integration:update-state": "jest --forceExit --env=node --runInBand test/update-state-v2.spec.js",
"test:integration:signing": "jest --forceExit --env=node --runInBand test/sign-verify.spec.js"
},
"author": "Absa Group Limited",
"dependencies": {
Expand Down
Empty file modified agents/node/vcxagent-core/publish.sh
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions agents/node/vcxagent-core/test/update-state-v2.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-env jest */
const { shutdownVcx } = require('@absaoss/node-vcx-wrapper')

require('jest')
const { createPairedAliceAndFaber } = require('./utils/utils')
const { initRustapi } = require('../src/index')
Expand All @@ -16,6 +18,7 @@ describe('test update state', () => {
await faber.sendCredentialOffer()
await alice.acceptCredentialOffer()
await expect(faber.updateStateCredentialV1()).rejects.toThrow('Obj was not found with handle')
await shutdownVcx()
})

it('Faber should send credential to Alice', async () => {
Expand Down

0 comments on commit a195be4

Please sign in to comment.