Repository navigation
PHOENIX-8069 Move PR precommit and branch builds from Jenkins to GitHub Actions - #2674
Conversation
…ub Actions Add GitHub Actions workflows that replace the ci-hadoop Jenkins jobs: * phoenix-precommit.yml replaces Jenkinsfile.github. It runs Yetus 0.13.0 (the same release) as a general check plus one unit check per test group. * phoenix-branch-build.yml replaces Jenkinsfile. It builds the HBase 2.5 and 2.6 profiles on every push to master and 5.* branches. A GitHub-hosted job can run for at most 6 hours, so the tests are split by the existing failsafe groups (ParallelStatsEnabledTest, ParallelStatsDisabledTest, NeedsOwnMiniClusterTest) and by IT class name ranges, see dev/phoenix-test-group-args.sh. Together the jobs run the same tests as the single Jenkins job. Jenkins limits are kept, or made stricter: * Build artifacts are kept for 2 days. * At most 15 jobs run at the same time (ASF recommended limit). * One build at a time per PR, and at most 2 PR builds in 24 hours. A manual re-run is not counted. * 30 minute HBase rebuild timeout. Also add Dependabot for GitHub Actions, as the ASF GitHub Actions policy requires.
…and in unit check summaries
5618709 to
a4700db
Compare
…bledIT The class was tagged @category(ParallelStatsEnabledIT.class) instead of ParallelStatsEnabledTest, so no failsafe execution selected it and it never ran.
…AbortIT Failsafe only runs test classes whose name ends in IT, so this test never ran. The new name differs from the old one by more than case, as Yetus rejects a patch that renames a file by changing only its case.
a4700db to
1ed5224
Compare
The test fails, so comment out its test group @category. Maven then does not run it, as before it was renamed to end in IT.
…name The Results section of the Maven output names a failure in a helper or @after method by the helper, for example UpsertSelectIT.assertNoConnLeak:114->waitForOpenConnectionsToSettle:129, which the summary did not recognise as a test, so the Failed Tests table was missing. Take failures and errors from the per-test lines instead.
The tests are split across several unit check jobs by test group and class name. Add two checks so that no test class is silently left out: * General check: before Yetus, fail if an IT class in a test group cannot be selected by any job, because its name does not end in IT or does not start with a letter A-Z. IT classes with no test group @category are listed as a warning, as Maven never runs them. * Test coverage: a job after the unit checks that collects the classes each job ran, and fails if a test class that Maven should run ran in no job or in more than one job.
Yetus writes the Maven test output to patch-unit-<module>.txt, so the console shows nothing while the tests run, which can be hours. Follow that file while Yetus runs and print the start and the result of each test class, the failed tests and the build result, with the time.
Up to 15 jobs at the same time is the ASF recommended maximum, not a target. Run at most 6, so that the Phoenix builds leave runners for the other ASF projects. The test groups that do not fit wait for a free slot, so a build takes longer but runs the same tests.
1ed5224 to
ceb9348
Compare
Only the newest commit of a PR needs a build, so a new commit now cancels the running build of the PR instead of waiting for it. A cancelled build still counts against the limit of 2 builds per PR in 24 hours.
… in CI Each NeedsOwnMiniClusterTest class runs in its own forked JVM, which failsafe kills after 1800 seconds. On the 4 CPU GitHub-hosted runners some classes take longer, and the build then fails although all tests pass: BackwardCompatibilityIT took 5977 seconds, and GlobalIndexCheckerEventualGenerateIT and GlobalIndexCheckerEventualIT took 2648 and 2295 seconds. Make the timeout a property, forkedProcessTimeoutIT, that stays 1800 seconds by default, and set it to 7200 seconds in the GitHub Actions precommit and branch builds.
A new commit cancels the running build of the PR, and the cancelled build still counts against the limit, so 2 builds in 24 hours (the Jenkins limit) is too few. Allow 4.
GitHub Actions now runs the PR precommit and the branch builds, so remove Jenkinsfile.github, Jenkinsfile and the Docker image that only the branch build used. Jenkinsfile.yetus, which tests patches attached to JIRA, is kept.
|
The Test coverage check failed |
+1. To catch similar issues e.g. duplicate runs of tests, missing runs of tests etc, I have introduced additional coverage step. |
|
JIRA: PHOENIX-8069
Why
Phoenix PR precommit (
Jenkinsfile.github) and branch builds (Jenkinsfile) run on ci-hadoop.apache.org, which has not been reachable for about a week. This PR moves both builds to GitHub Actions. The Jenkins limits and test grouping are kept, and some limits are made stricter.What
.github/workflows/phoenix-precommit.ymlreplacesJenkinsfile.github. It runs onpull_request(notpull_request_target, which ASF disables from November 2026). It runs Yetus 0.13.0, the same release Jenkins used, as 12 jobs:unit).github/workflows/phoenix-branch-build.ymlreplacesJenkinsfile. It runs on every push tomasterand5.*, and can be started by hand. It builds the HBase 2.5 and 2.6 profiles, 10 jobs per profile, and rebuilds HBase first asdev/rebuild_hbase.shdoes today.dev/phoenix-test-group-args.sh(new) prints the Maven arguments that limit a build to one test group.dev/jenkins_precommit_github_yetus.shanddev/phoenix-personality.shstill work on Jenkins and now also run under GitHub Actions. They pass the test group and the fork counts to Maven.dev/yetus_console_to_md.pyis copied from HBase, with pylint fixes, and failed tests are taken from the per-test lines of the Maven output. It writes the Yetus result to the job summary.dev/phoenix-list-tests.sh,dev/phoenix-test-progress.shanddev/phoenix_check_tests.py(new) list the tests run, show the test progress, and check the test coverage..github/dependabot.ymlkeeps the actions up to date, as the ASF GitHub Actions policy requires.Test split
A GitHub-hosted job can run for at most 6 hours. Jenkins ran every test in one job with an 11 hour timeout. The tests are split by the existing groups in the root
pom.xml, and the two large groups are split again by the first letter of the test class name:ParallelStatsEnabledTestParallelStatsDisabledTestNeedsOwnMiniClusterTestTogether the jobs run the same tests as the single Jenkins job, with no test left out or run twice.
Limits
Differences from Jenkins
pom.xmldefaults: 8 and 7). The Yetus docker memory limit is 14g (Jenkins: 20g).Test checks and reporting
ITor does not start with a letter A-Z.Test fixes
SaltedTableWithParallelStatsEnabledIThad the wrong test category, so no execution ran it.PreMatureTimelyAbortScanItwas renamed toPreMatureTimelyAbortScanIT. Failsafe only picks up classes ending inIT.IT classes that are never run
These IT classes have no test group
@Categoryon the class or a parent class, so Maven has never run them, on Jenkins or here. This PR leaves them as they are. The test class name check lists them as a warning.org.apache.phoenix.end2end.DynamicColumnWildcardITorg.apache.phoenix.end2end.GlobalConnectionTenantTableITorg.apache.phoenix.end2end.IndexScrutinyWithMaxLookbackITorg.apache.phoenix.end2end.MixedCaseInnerJoinAliasesITorg.apache.phoenix.end2end.NonParameterizedIndexScrutinyToolITorg.apache.phoenix.end2end.SyncUpdateCacheFreqITorg.apache.phoenix.end2end.SystemTablesUpgradeITorg.apache.phoenix.end2end.UpgradeIndexToolTablesITorg.apache.phoenix.end2end.UpgradeIndexToolTablesNameSpaceMappingDisabledITorg.apache.phoenix.end2end.index.IndexTwoPhaseCreateITorg.apache.phoenix.end2end.index.LocalIndexITorg.apache.phoenix.end2end.transform.TransformITorg.apache.phoenix.end2end.transform.TransformMonitorITorg.apache.phoenix.end2end.transform.TransformToolITTest runs on a fork
The workflows were run on a fork before this PR. The unit tests and the
ParallelStatsEnabledTestandParallelStatsDisabledTestslices took 7 to 36 minutes each on GitHub-hosted runners. OneParallelStatsDisabledTestslice failed on a flakyUpsertSelectIT.testParallelUpsertSelectconnection leak assertion, which is not related to this PR. TheNeedsOwnMiniClusterTestslices were cancelled before they finished.Not yet measured
NeedsOwnMiniClusterTestslices take, and the total build time with at most 6 jobs at the same time. The slices may need adjusting after the first runs.Out of scope
Jenkinsfile.yetus(patches attached to JIRA).