Skip to content

Commit

Permalink
feat(apps-backend): move e2e tests to another config.
Browse files Browse the repository at this point in the history
  • Loading branch information
panteleymonchuk committed Oct 29, 2024
1 parent 3afc18e commit ea05439
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ on:
isGraphQlTransport:
type: boolean
required: true
isAppsBackend:
type: boolean
required: true
isDevelop:
type: boolean
required: true
Expand Down Expand Up @@ -72,9 +69,7 @@ jobs:
- name: Run TS SDK e2e tests
if: inputs.isTypescriptSDK || inputs.isRust || inputs.isDevelop
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @iota/iota-sdk test:e2e'
- name: Run Apps Backend e2e tests
if: inputs.isAppsBackend
run: pnpm --filter apps-backend test:e2e

- name: Run RPC/GraphQL compatibility e2e tests
if: inputs.isGraphQlTransport || inputs.isRust || inputs.isDevelop
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @iota/graphql-transport test:e2e'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/apps_backend_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ jobs:
id: deploy_url
if: ${{ inputs.isProd == false }}
run: echo "DEPLOY_URL=$(cat vercel_output.txt | awk 'END{print}')" >> $GITHUB_OUTPUT
- name: E2E tests for deployed URL
run: DEPLOY_URL=${{ steps.deploy_url.outputs.DEPLOY_URL }} pnpm --filter apps-backend test:e2e
- name: Comment on pull request
if: ${{ inputs.isProd == false }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/hierarchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
isRust: ${{ needs.diff.outputs.isRust == 'true' }}

e2e:
if: (!cancelled() && !failure() && (github.event.pull_request.draft || github.ref_name == 'develop'))
if: (!cancelled() && !failure() && (!github.event.pull_request.draft || github.ref_name == 'develop'))
needs:
- diff
- dprint-format
Expand All @@ -147,7 +147,6 @@ jobs:
isExplorer: ${{ needs.diff.outputs.isExplorer == 'true' }}
isTypescriptSDK: ${{ needs.diff.outputs.isTypescriptSDK == 'true' }}
isGraphQlTransport: ${{ needs.diff.outputs.isGraphQlTransport == 'true' }}
isAppsBackend: ${{ needs.diff.outputs.isAppsBackend == 'true' }}
isDevelop: ${{ github.ref_name == 'develop' }}

vercel-deploy:
Expand All @@ -160,7 +159,7 @@ jobs:
uses: ./.github/workflows/_vercel_deploy.yml
secrets: inherit
with:
shouldDeployPreview: ${{github.event_name == 'pull_request' && github.event.pull_request.draft == false}}
shouldDeployPreview: ${{github.event_name == 'pull_request' && github.event.pull_request.draft == true}}
isExplorer: ${{ needs.diff.outputs.isExplorer == 'true' }}
isTypescriptSDK: ${{ needs.diff.outputs.isTypescriptSDK == 'true' }}
isAppsBackend: ${{ needs.diff.outputs.isAppsBackend == 'true' }}
Expand Down
10 changes: 8 additions & 2 deletions apps/apps-backend/test/health.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ describe('Health Check (e2e)', () => {
await app.close();
});

it('/health (GET)', () => {
return request(app.getHttpServer()).get('/health').expect(200).expect({ status: 'ok' });
it('/health (GET)', async () => {
const DEPLOYED_URL = process.env.DEPLOYED_URL || null;

if (DEPLOYED_URL) {
await request(DEPLOYED_URL).get('/health').expect(200).expect({ status: 'ok' });
} else {
await request(app.getHttpServer()).get('/health').expect(200).expect({ status: 'ok' });
}
});
});

0 comments on commit ea05439

Please sign in to comment.