Skip to content

Commit a019c4d

Browse files
authored
Merge pull request #683 from safedep/test/676-enable-e2e-for-entitlement-switcher
test: enabled e2e test for entitelemtn auto switch message
2 parents 8276d9d + 23f1334 commit a019c4d

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ jobs:
104104
# This will not be available when there is a PR from a forked repository
105105
VET_API_KEY: ${{ secrets.SAFEDEP_CLOUD_API_KEY }}
106106
VET_CONTROL_TOWER_TENANT_ID: ${{ secrets.SAFEDEP_CLOUD_TENANT_DOMAIN }}
107+
# Free tier keys, used in e2e test scenerio 15
108+
VET_API_KEY_FREE: ${{ secrets.SAFEDEP_CLOUD_API_KEY_FREE }}
109+
VET_CONTROL_TOWER_TENANT_ID_FREE: ${{ secrets.SAFEDEP_CLOUD_TENANT_DOMAIN_FREE }}
107110

108111
build-container-test:
109112
runs-on: ubuntu-latest

test/scenarios/all.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,4 @@ bash $E2E_THIS_DIR/scenario-11-code-csvreport.sh
2525
bash $E2E_THIS_DIR/scenario-12-image-scan-local-docker-image.sh
2626
bash $E2E_THIS_DIR/scenario-13-image-scan-with-local-tar.sh
2727
bash $E2E_THIS_DIR/scenario-14-image-scan-with-remote-registry.sh
28-
29-
# TODO: Once Backend has inforced on-demand entitlement, then source this,currently we can't test enricher auto-switch since
30-
# all tenants have on-demand capabilities.
31-
# bash $E2E_THIS_DIR/scenario-15-enricher-auto-switch.sh
28+
bash $E2E_THIS_DIR/scenario-15-enricher-auto-switch.sh

test/scenarios/scenario-15-enricher-auto-switch.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@ if [ "$E2E_VET_INSIGHTS_V2" != "true" ]; then
1010
exit 0
1111
fi
1212

13+
if [ -z "$VET_API_KEY_FREE" ] || [ -z "$VET_CONTROL_TOWER_TENANT_ID_FREE" ]; then
14+
echo "Error: scenario-15-enricher-auto-switch.sh requires VET_API_KEY_FREE and VET_CONTROL_TOWER_TENANT_ID_FREE to be set"
15+
exit 1
16+
fi
17+
1318
# Run the command and capture output
14-
$E2E_VET_SCAN_CMD --purl pkg:/npm/@clerk/nextjs@6.9.6 \
19+
# use free user api keys and tenant id to test entitlement warning messages
20+
env VET_API_KEY=$VET_API_KEY_FREE \
21+
VET_CONTROL_TOWER_TENANT_ID=$VET_CONTROL_TOWER_TENANT_ID_FREE \
22+
$E2E_VET_SCAN_CMD --purl pkg:/npm/@clerk/nextjs@6.9.6 \
1523
--malware \
1624
--report-markdown-summary=sum.md 2>&1 | tee scenario-output.log
1725

0 commit comments

Comments
 (0)