0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(test): refactor integration-test workflow to link mock connectors (#1720)

* refactor(test): another way to link mock connectors in integration tests

* refactor(test): extract link-mock-connectors.sh

* refactor(test): remove unused env variable in integration-test.yml
This commit is contained in:
IceHe.Life 2022-08-02 18:10:01 +08:00 committed by GitHub
parent a62793a3f0
commit ff151b2010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 14 deletions

View file

@ -22,9 +22,9 @@ jobs:
uses: silverhand-io/actions-node-pnpm-run-steps@v1.2.3 uses: silverhand-io/actions-node-pnpm-run-steps@v1.2.3
- name: Package - name: Package
run: ./package.sh run: |
env: ./link-mock-connectors.sh
INTEGRATION_TEST: true ./package.sh
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:

11
link-mock-connectors.sh Executable file
View file

@ -0,0 +1,11 @@
set -eo pipefail
echo Link the mock connectors for integration tests only
cd packages/core
pnpm link @logto/connector-mock-sms
pnpm link @logto/connector-mock-email
pnpm link @logto/connector-mock-social
cd -
echo Update the pnpm-lock.json
pnpm i --no-frozen-lockfile --lockfile-only

View file

@ -7,17 +7,7 @@ echo Prune dependencies
rm -rf node_modules packages/*/node_modules rm -rf node_modules packages/*/node_modules
echo Install production dependencies echo Install production dependencies
if [[ $INTEGRATION_TEST =~ ^(true|1)$ ]]; then
echo Install the mock connectors for integration tests only
cd packages/core
pnpm link @logto/connector-mock-sms
pnpm link @logto/connector-mock-email
pnpm link @logto/connector-mock-social
cd -
NODE_ENV=production pnpm i --no-frozen-lockfile
else
NODE_ENV=production pnpm i NODE_ENV=production pnpm i
fi
echo Prune files echo Prune files
rm -rf \ rm -rf \