diff options
| author | Naoto Ono <onoto1998@gmail.com> | 2024-12-13 16:13:40 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-13 07:13:40 +0000 |
| commit | 1d3091b4db5656f8feb3dfe5113573d80352b72d (patch) | |
| tree | 02716a997f013a13149de8030960aac9e6d4307f | |
| parent | e91b25ec8dc84e16496ab2a2490338aeb101731d (diff) | |
Launchable: Refactor entrypoint.sh (#12314)
* Use `launchable record session` command to split test sessions based on test suites.
* Use BTESTS env instead of RUBY_TESTOPTS for passing CLI option to `make btest`.
* Group Launchable logs
* Add several flavors to identify the relationship between test session and GH workflow.
Notes
Notes:
Merged-By: ono-max <onoto1998@gmail.com>
| -rwxr-xr-x | .github/actions/compilers/entrypoint.sh | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/.github/actions/compilers/entrypoint.sh b/.github/actions/compilers/entrypoint.sh index a9bb5f0bb7..df825a356c 100755 --- a/.github/actions/compilers/entrypoint.sh +++ b/.github/actions/compilers/entrypoint.sh @@ -70,7 +70,7 @@ if [[ -n "${INPUT_STATIC_EXTS}" ]]; then echo "::endgroup::" fi -ruby_test_opts='' +btests='' tests='' # Launchable @@ -80,18 +80,47 @@ setup_launchable() { # As a workaround, we set LAUNCHABLE_SESSION_DIR to ${builddir}. export LAUNCHABLE_SESSION_DIR=${builddir} local github_ref="${GITHUB_REF//\//_}" - boot_report_path='launchable_bootstraptest.json' + local build_name="${github_ref}"_"${GITHUB_PR_HEAD_SHA}" + btest_report_path='launchable_bootstraptest.json' test_report_path='launchable_test_all.json' - ruby_test_opts+=--launchable-test-reports="${boot_report_path}" - tests+=--launchable-test-reports="${test_report_path}" - grouped launchable record build --name "${github_ref}"_"${GITHUB_PR_HEAD_SHA}" || true + test_all_session_file='launchable_test_all_session.txt' + btest_session_file='launchable_btest_session.txt' + btests+=--launchable-test-reports="${btest_report_path}" + echo "::group::Setup Launchable" + launchable record build --name "${build_name}" || true + launchable record session \ + --build "${build_name}" \ + --flavor test_task=test \ + --flavor workflow=Compilations \ + --flavor with-gcc="${INPUT_WITH_GCC}" \ + --flavor CFLAGS="${INPUT_CFLAGS}" \ + --flavor CXXFLAGS="${INPUT_CXXFLAGS}" \ + --flavor optflags="${INPUT_OPTFLAGS}" \ + --flavor cppflags="${INPUT_CPPFLAGS}" \ + --test-suite btest \ + > "${builddir}"/${btest_session_file} + if [ "$INPUT_CHECK" = "true" ]; then + tests+=--launchable-test-reports="${test_report_path}" + launchable record session \ + --build "${build_name}" \ + --flavor test_task=test-all \ + --flavor workflow=Compilations \ + --flavor with-gcc="${INPUT_WITH_GCC}" \ + --flavor CFLAGS="${INPUT_CFLAGS}" \ + --flavor CXXFLAGS="${INPUT_CXXFLAGS}" \ + --flavor optflags="${INPUT_OPTFLAGS}" \ + --flavor cppflags="${INPUT_CPPFLAGS}" \ + --test-suite test-all \ + > "${builddir}"/${test_all_session_file} + fi + echo "::endgroup::" trap launchable_record_test EXIT } launchable_record_test() { pushd "${builddir}" - grouped launchable record tests --flavor test_task=test --test-suite bootstraptest raw "${boot_report_path}" || true + grouped launchable record tests --session "$(cat "${btest_session_file}")" raw "${btest_report_path}" || true if [ "$INPUT_CHECK" = "true" ]; then - grouped launchable record tests --flavor test_task=test-all --test-suite test-all raw "${test_report_path}" || true + grouped launchable record tests --session "$(cat "${test_all_session_file}")" raw "${test_report_path}" || true fi } if [ "$LAUNCHABLE_ENABLED" = "true" ]; then @@ -102,7 +131,7 @@ pushd ${builddir} grouped make showflags grouped make all -grouped make test RUBY_TESTOPTS="${ruby_test_opts}" +grouped make test BTESTS="${btests}" [[ -z "${INPUT_CHECK}" ]] && exit 0 |
