-
Notifications
You must be signed in to change notification settings - Fork 1
[HOTE-803] feat: Add some improvements to E2E tests #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2575a9f
fb69751
0865ba6
dbdf9ca
9207b17
af74217
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,13 +91,17 @@ jobs: | |
| playwright-${{ runner.os }}- | ||
|
|
||
| - name: "Install Playwright browsers" | ||
| timeout-minutes: 3 | ||
| working-directory: tests | ||
| run: npx playwright install --with-deps | ||
|
Comment on lines
93
to
96
|
||
|
|
||
| - name: "Start the application" | ||
| if: env.TARGET_ENV == 'local' | ||
| run: | | ||
| npm run start | ||
| npm run local:start | ||
| env: | ||
| BUILDKIT_PROGRESS: plain # or "quiet" to fully suppress build output | ||
| DOCKER_CLI_HINTS: false # removes "What's next?" hints | ||
|
Comment on lines
98
to
+104
|
||
|
|
||
| - name: "Show application status" | ||
| if: env.TARGET_ENV == 'local' | ||
|
|
@@ -179,6 +183,34 @@ jobs: | |
| docker compose -f local-environment/docker-compose.yml logs "$service" > "tests/testResults/docker-compose-${service}.log" 2>&1 | ||
| done | ||
|
|
||
| - name: "Detect flaky tests" | ||
| if: always() | ||
| run: | | ||
| RESULTS_FILE="tests/testResults/test-results.json" | ||
| if [ ! -f "$RESULTS_FILE" ]; then | ||
| echo "No test results JSON found, skipping flaky detection" | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Check top-level stats for flaky count first | ||
| FLAKY_COUNT=$(jq '.stats.flaky // 0' "$RESULTS_FILE" 2>/dev/null || echo 0) | ||
| echo "Flaky test count: $FLAKY_COUNT" | ||
|
|
||
| if [ "$FLAKY_COUNT" -gt 0 ]; then | ||
| # Extract flaky test details: specs contain tests, status is on test objects | ||
| FLAKY_TESTS=$(jq -r ' | ||
| [.. | .specs?[]? | {title: .title, file: .file, line: .line, tests: [.tests[]? | select(.status == "flaky") | .projectName]} | select(.tests | length > 0)] | ||
| | .[] | "[\(.tests | join(", "))] \(.title) (\(.file):\(.line))" | ||
| ' "$RESULTS_FILE" 2>/dev/null) | ||
|
|
||
| echo "::warning::Flaky tests detected (passed on retry):" | ||
| while IFS= read -r test; do | ||
| echo "::warning:: Flaky: $test" | ||
| done <<< "$FLAKY_TESTS" | ||
| else | ||
| echo "No flaky tests detected" | ||
| fi | ||
|
|
||
| - name: "Publish Test Results" | ||
| uses: dorny/test-reporter@v3 | ||
| if: always() | ||
|
|
@@ -210,6 +242,22 @@ jobs: | |
| echo ":warning: No test results found" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
|
|
||
| # Append flaky test details to summary | ||
| RESULTS_FILE="tests/testResults/test-results.json" | ||
| if [ -f "$RESULTS_FILE" ]; then | ||
| FLAKY_COUNT=$(jq '.stats.flaky // 0' "$RESULTS_FILE" 2>/dev/null || echo 0) | ||
| if [ "$FLAKY_COUNT" -gt 0 ]; then | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### :warning: Flaky Tests ($FLAKY_COUNT)" >> $GITHUB_STEP_SUMMARY | ||
| echo "These tests failed initially but passed on retry:" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| jq -r ' | ||
| [.. | .specs?[]? | {title: .title, file: .file, line: .line, tests: [.tests[]? | select(.status == "flaky") | .projectName]} | select(.tests | length > 0)] | ||
| | .[] | "- **[\(.tests | join(", "))] \(.title)** (\(.file):\(.line))" | ||
| ' "$RESULTS_FILE" 2>/dev/null >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
| fi | ||
|
|
||
| - name: "Upload test results" | ||
| uses: actions/upload-artifact@v7 | ||
| if: always() | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,10 +6,6 @@ install_before = "7d" | |||||||||
| [settings.python] | ||||||||||
| compile = false | ||||||||||
|
|
||||||||||
|
||||||||||
| [settings.aqua] | |
| cosign = false |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,19 +8,46 @@ repos: | |||||||||||||||||
| args: [--markdown-linebreak-ext=md] | ||||||||||||||||||
| - id: end-of-file-fixer | ||||||||||||||||||
| - id: check-yaml | ||||||||||||||||||
| args: [--allow-multiple-documents] | ||||||||||||||||||
| - id: check-json | ||||||||||||||||||
| - id: check-toml | ||||||||||||||||||
| - id: check-added-large-files | ||||||||||||||||||
| args: ["--maxkb=500"] | ||||||||||||||||||
| - id: check-case-conflict | ||||||||||||||||||
| - id: check-merge-conflict | ||||||||||||||||||
| - id: check-symlinks | ||||||||||||||||||
| - id: detect-private-key | ||||||||||||||||||
| - id: check-executables-have-shebangs | ||||||||||||||||||
| - id: forbid-submodules | ||||||||||||||||||
| - id: mixed-line-ending | ||||||||||||||||||
| args: [--fix=lf] | ||||||||||||||||||
| - id: no-commit-to-branch | ||||||||||||||||||
| args: [--branch, main, --branch, master, --branch, develop] | ||||||||||||||||||
|
|
||||||||||||||||||
| # # https://github.com/google/osv-scanner/releases | ||||||||||||||||||
| # - repo: https://github.com/google/osv-scanner | ||||||||||||||||||
| # rev: v2.3.5 | ||||||||||||||||||
| # hooks: | ||||||||||||||||||
| # - id: osv-scanner | ||||||||||||||||||
|
|
||||||||||||||||||
| - repo: local | ||||||||||||||||||
| hooks: | ||||||||||||||||||
| - id: trivy-fs-scan | ||||||||||||||||||
| name: Trivy filesystem scan | ||||||||||||||||||
| entry: trivy fs --scanners vuln --severity HIGH,CRITICAL --exit-code 1 . | ||||||||||||||||||
| # - id: grype-fs-scan | ||||||||||||||||||
| # name: Grype filesystem vulnerability scan | ||||||||||||||||||
| # entry: scripts/grype-scan.sh | ||||||||||||||||||
| # language: script | ||||||||||||||||||
| # pass_filenames: false | ||||||||||||||||||
| # always_run: true | ||||||||||||||||||
| # require_serial: true | ||||||||||||||||||
|
|
||||||||||||||||||
| # - id: osv-scanner | ||||||||||||||||||
| # name: OSV-Scanner dependency vulnerability scan | ||||||||||||||||||
| # entry: osv-scanner scan --recursive --format table . | ||||||||||||||||||
| # language: system | ||||||||||||||||||
| # pass_filenames: false | ||||||||||||||||||
|
|
||||||||||||||||||
| - id: grype | ||||||||||||||||||
| name: grype | ||||||||||||||||||
| entry: bash -c 'echo $PWD; whereis grype; grype --version; grype "dir:$PWD" --quiet -o template -t $PWD/scripts/config/grype-table.tmpl --name hometest-service -c $PWD/scripts/config/grype.yaml' | ||||||||||||||||||
|
||||||||||||||||||
| entry: bash -c 'echo $PWD; whereis grype; grype --version; grype "dir:$PWD" --quiet -o template -t $PWD/scripts/config/grype-table.tmpl --name hometest-service -c $PWD/scripts/config/grype.yaml' | |
| entry: bash -c 'echo "$PWD"; whereis grype; grype --version; grype "dir:$PWD" --quiet -o template -t "$PWD/scripts/config/grype-table.tmpl" --name hometest-service -c "$PWD/scripts/config/grype.yaml"' |
Copilot
AI
Apr 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grype pre-commit hook runs a long inline bash -c command with unquoted $PWD paths, which will break if the repo path contains spaces and makes the hook harder to maintain. Prefer calling the dedicated scripts/grype-scan.sh (or the existing scripts/reports/scan-vulnerabilities.sh) and ensure all paths are quoted; also drop the echo $PWD/whereis debug output unless it’s needed.
| entry: bash -c 'echo $PWD; whereis grype; grype --version; grype "dir:$PWD" --quiet -o template -t $PWD/scripts/config/grype-table.tmpl --name hometest-service -c $PWD/scripts/config/grype.yaml' | |
| language: system | |
| pass_filenames: false | |
| entry: scripts/grype-scan.sh | |
| language: script | |
| pass_filenames: false | |
| always_run: true | |
| require_serial: true |
Copilot
AI
Apr 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grype-fs-scan and the additional grype hook both run a full filesystem Grype scan on every commit, which will double the runtime of pre-commit (and CI pre-commit) without adding coverage; consider keeping just one hook (ideally the scripted one) to avoid redundant scanning.
| - id: grype | |
| name: grype | |
| entry: bash -c 'echo $PWD; whereis grype; grype --version; grype "dir:$PWD" --quiet -o template -t $PWD/scripts/config/grype-table.tmpl --name hometest-service -c $PWD/scripts/config/grype.yaml' | |
| language: system | |
| pass_filenames: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 3-minute step timeout for
npx playwright install --with-depsis likely too low on cache-miss runners (apt deps + browser downloads can exceed this), causing avoidable CI failures; increase/remove the timeout or apply it only to the download portion when cache is warm.