Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/qunit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
shell: bash
env:
DEVEXTREME_TEST_CI: "true"
run: pnpm exec nx build:systemjs
run: pnpm exec nx build:dev

- name: Zip artifacts
working-directory: ./packages/devextreme
Expand All @@ -127,7 +127,7 @@ jobs:

qunit-tests:
needs: build
runs-on: devextreme-shr2
runs-on: ${{ github.event_name == 'merge_group' && 'devextreme-shr2-ondemand' || 'devextreme-shr2' }}
name: Constel ${{ matrix.CONSTEL }}${{ matrix.TIMEZONE != '' && format('-{0}', matrix.TIMEZONE) || '' }}${{ matrix.CSP == 'false' && '-no-csp' || '' }}
timeout-minutes: 25
strategy:
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/repository-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,95 @@ on:
branches:
- main

permissions: {}

jobs:
collect-flaky-reports:
name: Collect flaky reports
runs-on: ubuntu-slim
permissions:
contents: read # checkout
actions: read # list workflow runs and download their artifacts
# Flaky collection must never break the repository check it feeds.
continue-on-error: true
outputs:
details: ${{ steps.collect.outputs.details }}

steps:
- name: Get sources
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0

- name: Use Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version-file: '.node-version'

- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
with:
run_install: false

- name: Install dependencies
run: pnpm install --frozen-lockfile --filter flaky-test-reporter...

- name: Collect flaky test candidates
id: collect
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WINDOW_HOURS: 72
run: |
# tee opens the log before the tool runs, so the directory must already exist.
mkdir -p "$GITHUB_WORKSPACE/artifacts"
report="$GITHUB_WORKSPACE/artifacts/flaky-tests-report.json"
markdown="$GITHUB_WORKSPACE/artifacts/flaky-tests-report.md"
log="$GITHUB_WORKSPACE/artifacts/collect.log"

# --silent keeps pnpm's own banner out of the summary; 2>&1 keeps the tool's warnings in.
# tee stores the plain text for the summary, then sed turns the tool's warnings into
# GitHub annotations so they surface on the run page.
pnpm --silent --filter flaky-test-reporter run collect -- \
--repo "${{ github.repository }}" \
--workflow testcafe_tests.yml \
--artifact flaky-candidates \
--branch "${{ github.ref_name }}" \
--window-hours "$WINDOW_HOURS" \
--out-json "$report" \
--out-markdown "$markdown" 2>&1 \
| tee "$log" \
| sed -e 's/^warning: /::warning::/' -e 's/^Collection failed: /::error::/'

{
echo "## Flaky test candidates"
echo ""
echo '```'
cat "$log"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"

# Multiline output form, so the markdown crosses the job boundary as-is. The delimiter
# must not occur in the content, which markdown headings and tables never produce.
{
echo 'details<<FLAKY_DETAILS_EOF'
cat "$markdown"
echo 'FLAKY_DETAILS_EOF'
} >> "$GITHUB_OUTPUT"

- name: Upload flaky test report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: flaky-tests-report
path: |
${{ github.workspace }}/artifacts/flaky-tests-report.json
${{ github.workspace }}/artifacts/collect.log
retention-days: 7
if-no-files-found: ignore

invoke:
name: Invoke
needs: [collect-flaky-reports]
permissions:
contents: read # the reusable workflow checks this repository out
if: ${{ !cancelled() }}
uses: DevExpress/github-actions/.github/workflows/repository-check.yml@repository-check
with:
config: |
Expand All @@ -20,3 +106,6 @@ jobs:
'GHSA-848j-6mx2-7j84', // elliptic
]
}
# Markdown appended to this repo's monitor issue body. Empty when the collect job
# produced nothing, which makes the shared workflow skip publishing it.
extraDetails: ${{ needs.collect-flaky-reports.outputs.details }}
27 changes: 27 additions & 0 deletions .github/workflows/testcafe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,15 @@ jobs:
quarantined_failed=0
result=./artifacts/quarantine-run-result.json
new_flakes_summary=./artifacts/new-flakes-summary.txt
new_flakes=./artifacts/flaky-candidates.jsonl
report_json=./artifacts/flaky-candidates.json
# base_ref is empty for push and merge_group, which carry the target elsewhere.
base_branch="${{ github.base_ref || github.event.merge_group.base_ref || github.ref_name }}"
base_branch="${base_branch#refs/heads/}"
mkdir -p ./artifacts
: > "$new_flakes_summary"
: > "$new_flakes"
rm -f "$report_json"

# Every test gets up to 3 attempts (initial run + 2 retries) and passes
# if at least one attempt succeeds. A reported failure means all attempts failed.
Expand Down Expand Up @@ -549,12 +556,23 @@ jobs:
while IFS= read -r name; do
if jq -e --arg n "$name" '.tests | index($n)' "$result" > /dev/null; then
echo "FAILED | $name | $job_name" >> "$new_flakes_summary"
verdict=failed
else
echo "passed | $name | $job_name" >> "$new_flakes_summary"
verdict=passed
fi
jq -cn --arg test "$name" --arg sourceJob "$job_name" --arg theme "$theme" \
--arg componentFolder "$componentFolder" --arg timezone "$timezone" \
--arg platform "$platform" --arg verdict "$verdict" --arg baseBranch "$base_branch" \
'{ test: $test, sourceJob: $sourceJob, theme: $theme, componentFolder: $componentFolder, timezone: $timezone, platform: $platform, verdict: $verdict, baseBranch: $baseBranch }' \
>> "$new_flakes"
done < <(jq -r '.tests[]' "$report")
done

if [ -s "$new_flakes" ]; then
jq -s '{ schemaVersion: 1, candidates: . }' "$new_flakes" > "$report_json"
fi

sudo ln -sf /usr/share/zoneinfo/GMT /etc/localtime

echo ""
Expand Down Expand Up @@ -631,6 +649,15 @@ jobs:
path: ${{ github.workspace }}/e2e/testcafe-devextreme/artifacts/failedtests/**/*
if-no-files-found: ignore

- name: Upload flaky candidates report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: flaky-candidates
path: ${{ github.workspace }}/e2e/testcafe-devextreme/artifacts/flaky-candidates.json
retention-days: 7
if-no-files-found: ignore

merge-artifacts:
runs-on: ubuntu-latest
needs: [testcafe, testcafe-quarantine]
Expand Down
Loading
Loading