diff options
| author | MoonEyes <ducoinbenjamin@yahoo.fr> | 2026-11-30 17:50:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-30 17:50:13 +0100 |
| commit | 61666057a21235fb048db49fadc7eaec902fa134 (patch) | |
| tree | 4f43ff875622f186f1a49a75fb5b54222381e536 /docs/testing.md | |
| parent | 1ad7867a2cb60e2aa657ad36611498f0ab99ad77 (diff) | |
| parent | 9f2ca5899287a8dd5fa78b963181fc7bb52898a1 (diff) | |
Merge pull request #2747 from OreoFR/docs/fork-ci-red-green
docs/testing: red and green of a runtime pull request on your fork's CI
Diffstat (limited to 'docs/testing.md')
| -rw-r--r-- | docs/testing.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/docs/testing.md b/docs/testing.md index 9a5e1eaae..dbf9b05af 100644 --- a/docs/testing.md +++ b/docs/testing.md | |||
| @@ -83,6 +83,52 @@ Run `main` the same way for comparison (`git checkout main`, rebuild, run). Then | |||
| 83 | one line per mode, in the form `<GPU>, <driver>, Windows <build>: X of Y passed, K skipped, F failed (native); | 83 | one line per mode, in the form `<GPU>, <driver>, Windows <build>: X of Y passed, K skipped, F failed (native); |
| 84 | main at <commit>: ...`, plus any `FAIL` lines that differ from `main`. | 84 | main at <commit>: ...`, plus any `FAIL` lines that differ from `main`. |
| 85 | 85 | ||
| 86 | #### A runtime pull request, red and green on your fork's CI | ||
| 87 | |||
| 88 | A C++ pull request to `runtime/` can be checked red and green on the Runtime workflow of your own fork, with the | ||
| 89 | compiler the CI provides, when you cannot build it locally. It uses your fork's Actions minutes, not the project's. | ||
| 90 | Starting a run on a fork is described in | ||
| 91 | [Without a compiler: a CI-built runtime](#without-a-compiler-a-ci-built-runtime). A fork run does not replace the pull | ||
| 92 | request's own CI here, nor someone else's verification: it is one more data point. | ||
| 93 | |||
| 94 | 1. **Bring your fork's `main` up to date** (`git push <fork> origin/main:main`). "Run workflow" lists only a | ||
| 95 | workflow that exists on the fork's default branch. | ||
| 96 | 2. **Make two branches from the same `main` commit**, and write that commit down: | ||
| 97 | - `ci-green/<N>`: `main` plus the pull request, `git merge --no-ff pr-<N>`. | ||
| 98 | - `ci-red/<N>`: `main` plus only the pull request's test and how it is built: the test file(s) **and** the | ||
| 99 | test's registration in `runtime/CMakeLists.txt` (`add_executable` / `add_test`). Apply that part of the pull | ||
| 100 | request's diff (`git diff <merge-base> pr-<N> -- runtime/CMakeLists.txt | git apply --3way`) rather than checking | ||
| 101 | out the pull request's whole `CMakeLists.txt`, which would also undo what `main` has added since. | ||
| 102 | 3. **Commit the red side's test before pushing.** `git apply --3way` only stages the CMake lines: stage the test | ||
| 103 | file(s) as well, check with `git diff --cached` that the staged change is just the test and its registration, | ||
| 104 | and commit it on `ci-red/<N>`. Without that commit the pushed branch is still the plain `main` commit, and the | ||
| 105 | red run has no such test. | ||
| 106 | 4. **Push both branches to the fork and start the runs**: | ||
| 107 | `gh workflow run runtime.yml --repo <you>/<fork> --ref ci-green/<N>`, the same with `ci-red/<N>`, then | ||
| 108 | `gh run list --repo <you>/<fork>` for their ids. A pull request that only adds tests has nothing to remove for | ||
| 109 | red: run `main` itself as the red side. | ||
| 110 | |||
| 111 | When the red side proves nothing: | ||
| 112 | |||
| 113 | - **The test includes a file the pull request adds** (a new header next to the code): the red branch does not | ||
| 114 | compile (`fatal error: ... No such file or directory`). That shows the test needs the new code, not that it catches | ||
| 115 | the bug. Write "red: does not build without the pull request's new file", not "red: fails". | ||
| 116 | - **The test and its CMake lines alone pass on `main`**: the test does not exercise the change, or `main` already | ||
| 117 | behaves. Report "no red". | ||
| 118 | - **The test is not registered**: if the CMake lines stay on the green side only, the red build has no such test and | ||
| 119 | `ctest` cannot fail it. Check that the test's name is in the red run's `ctest` output. | ||
| 120 | |||
| 121 | Reading the result: open the `windows` job, step "CPU runtime tests" | ||
| 122 | (`ctest --test-dir runtime/build --output-on-failure --timeout 300`). Each test is a line | ||
| 123 | `k/T Test #i: <name> .... Passed` (or `***Failed`, `***Not Run (Disabled)`); the summary is | ||
| 124 | `100% tests passed out of R`, then the tests that did not run and, on a failure, `The following tests FAILED:`. | ||
| 125 | `R` excludes disabled tests, so report "R/R passed, D disabled (out of T)". A threaded timing test can fail once | ||
| 126 | on a shared runner: rerun that side before calling it a regression. Other jobs (`macos`, `linux-gpu-tools`, | ||
| 127 | `wine`) can be red on `main` too; compare with `main`'s latest Runtime run before blaming the pull request. | ||
| 128 | |||
| 129 | Comment on the pull request with the two run links, the `main` commit, and per side the test's own line and the | ||
| 130 | summary (red: ...; green: ...). | ||
| 131 | |||
| 86 | ## What you need | 132 | ## What you need |
| 87 | 133 | ||
| 88 | - **Python 3.12+**, which `make_game.py` requires (it stops with "Python 3.12 or newer is needed" on an older one, so | 134 | - **Python 3.12+**, which `make_game.py` requires (it stops with "Python 3.12 or newer is needed" on an older one, so |