Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/performance-rebaseline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Update CI Performance Baseline

on:
workflow_dispatch:
inputs:
reason:
description: "Reason for re-baselining"
required: true
type: string

permissions:
contents: write

jobs:
rebaseline:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm ci

- name: Run performance tests (update baseline)
run: npm run test:performance:update-baseline
env:
CI: true
PERF_TESTS: "1"
PERF_UPDATE_BASELINE: "1"
PERF_BASELINE_FILE: "performance-baseline.ci.json"

- name: Commit CI baseline
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add test/performance/performance-baseline.ci.json
git commit -m "chore: update CI performance baseline

Reason: ${{ github.event.inputs.reason }}
Triggered by: @${{ github.actor }}
Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
git push

- name: Summary
run: |
echo "## Performance Baseline Updated" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Reason:** ${{ github.event.inputs.reason }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The CI baseline has been committed to \`test/performance/performance-baseline.ci.json\`." >> $GITHUB_STEP_SUMMARY
echo "Future performance test runs will compare against this baseline." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat coverage/performance-report.md >> $GITHUB_STEP_SUMMARY
40 changes: 40 additions & 0 deletions .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Performance Tests

on:
pull_request:
branches: [main]
paths:
- "srv/**"
- "lib/**"
- "test/performance/**"
- "package.json"
workflow_dispatch:

concurrency:
group: performance-${{ github.ref }}
cancel-in-progress: true

jobs:
performance:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm ci

- name: Run performance tests
run: npm run test:performance
env:
CI: true
PERF_TESTS: "1"
PERF_BASELINE_FILE: "performance-baseline.ci.json"
PERF_MAX_REGRESSION: "0.3"
PERF_MAX_SLOPE_VARIANCE: "0.3"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ mta_archives/
# Tests
coverage/
TEST-mocha.xml
.nyc_output/
.nyc_output/

# Performance baselines (machine-specific)
test/performance/performance-baseline.json
1 change: 1 addition & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"spec": "test/**/*.test.ts",
"ignore": ["test/performance/**"],
"recursive": true,
"timeout": 600000,
"require": ["ts-node/register/transpile-only"],
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"tar": "npm run build && cd gen && npm pack",
"watch-data-inspector-ui": "cds watch --open data-inspector-ui/webapp/index.html?sap-ui-xx-viewCache=false",
"test": "cross-env CDS_TYPESCRIPT=true mocha",
"test:performance": "cross-env CDS_TYPESCRIPT=true PERF_TESTS=1 mocha --config test/performance/.mocharc.performance.json",
"test:performance:update-baseline": "cross-env CDS_TYPESCRIPT=true PERF_TESTS=1 PERF_UPDATE_BASELINE=1 mocha --config test/performance/.mocharc.performance.json",
"test:performance:check-drift": "node test/performance/check-baseline-drift.js",
"coverage": "cross-env CDS_TYPESCRIPT=true c8 mocha"
},
"peerDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions test/performance/.mocharc.performance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"spec": "test/performance/**/*.test.ts",
"recursive": true,
"timeout": 600000,
"require": ["ts-node/register/transpile-only"],
"exit": true
}
616 changes: 616 additions & 0 deletions test/performance/PERFORMANCE-TESTING-STRATEGY.md

Large diffs are not rendered by default.

Loading
Loading