Launchable: Enable PTS observation mode (#12617)

Launchable offers the Predictive Test Selection feature for speeding up CI execution. Predictive Test Selection leverages machine learning to identify the right tests to run for a specific code change. By analyzing data from past test runs and considering the changes being tested, Launchable determines which tests are most relevant.

To evaluate the list of tests that Launchable selects, I enable PTS observation mode. Please note that there is no impacts on CI execution.
This commit is contained in:
Naoto Ono 2025-01-24 08:37:52 +09:00 committed by GitHub
parent 7ed08c4fd3
commit 76a67e4660
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
Notes: git 2025-01-23 23:38:10 +00:00
Merged-By: ono-max <onoto1998@gmail.com>

View file

@ -106,6 +106,9 @@ runs:
echo test_all_report_file='launchable_test_all_report.json' >> $GITHUB_OUTPUT
echo btest_report_file='launchable_btest_report.json' >> $GITHUB_OUTPUT
echo test_spec_report_dir='launchable_test_spec_report' >> $GITHUB_OUTPUT
echo test_all_subset_input_file='launchable_test_all_subset_input.txt' >> $GITHUB_OUTPUT
echo btest_subset_input_file='launchable_btest_subset_input.txt' >> $GITHUB_OUTPUT
echo test_spec_subset_input_file='launchable_test_spec_subset_input.txt' >> $GITHUB_OUTPUT
if: steps.enable-launchable.outputs.enable-launchable
- name: Set environment variables for Launchable
@ -158,31 +161,52 @@ runs:
if [ "${test_all_enabled}" = "true" ]; then
launchable record session \
--build "${build_name}" \
--observation \
--flavor os=${{ inputs.os }} \
--flavor test_task=${{ inputs.test-task }} \
--flavor test_opts=${test_opts} \
--test-suite ${test_all_test_suite} \
> "${test_all_session_file}"
find test -name "*_test.rb" -o -name "test_*.rb" | sed 's|^|file=|' > "${test_all_subset_input_file}"
launchable subset \
--non-blocking \
--target 90% \
--session "$(cat "${test_all_session_file}")" \
raw ${test_all_subset_input_file} > /dev/null
echo "TESTS=${TESTS} --launchable-test-reports=${test_all_report_file}" >> $GITHUB_ENV
fi
if [ "${btest_enabled}" = "true" ]; then
launchable record session \
--build "${build_name}" \
--observation \
--flavor os=${{ inputs.os }} \
--flavor test_task=${{ inputs.test-task }} \
--flavor test_opts=${test_opts} \
--test-suite ${btest_test_suite} \
> "${btest_session_file}"
find bootstraptest -name "*_test.rb" -o -name "test_*.rb" | sed 's|^|file=|' > "${btest_subset_input_file}"
launchable subset \
--non-blocking \
--target 90% \
--session "$(cat "${btest_session_file}")" \
raw ${btest_subset_input_file} > /dev/null
echo "BTESTS=${BTESTS} --launchable-test-reports=${btest_report_file}" >> $GITHUB_ENV
fi
if [ "${test_spec_enabled}" = "true" ]; then
launchable record session \
--build "${build_name}" \
--observation \
--flavor os=${{ inputs.os }} \
--flavor test_task=${{ inputs.test-task }} \
--flavor test_opts=${test_opts} \
--test-suite ${test_spec_test_suite} \
> "${test_spec_session_file}"
find spec/ruby -name "*_spec.rb" | sed 's|^|file=|' > "${test_spec_subset_input_file}"
launchable subset \
--non-blocking \
--target 90% \
--session "$(cat "${test_spec_session_file}")" \
raw ${test_spec_subset_input_file} > /dev/null
echo "SPECOPTS=${SPECOPTS} --launchable-test-reports=${test_spec_report_dir}" >> $GITHUB_ENV
fi
if: steps.enable-launchable.outputs.enable-launchable
@ -196,6 +220,9 @@ runs:
test_all_report_file: ${{ steps.global.outputs.test_all_report_file }}
btest_report_file: ${{ steps.global.outputs.btest_report_file }}
test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }}
test_all_subset_input_file: ${{ steps.global.outputs.test_all_subset_input_file }}
btest_subset_input_file: ${{ steps.global.outputs.btest_subset_input_file }}
test_spec_subset_input_file: ${{ steps.global.outputs.test_spec_subset_input_file }}
- name: Variables to report Launchable
id: variables
@ -261,6 +288,9 @@ runs:
rm -f "${test_report_path}"
rm -f "${btest_report_path}"
rm -fr "${test_spec_report_path}"
rm -f "${test_all_subset_input_file}"
rm -f "${btest_subset_input_file}"
rm -f "${test_spec_subset_input_file}"
if: ${{ always() && steps.enable-launchable.outputs.enable-launchable }}
env:
test_report_path: ${{ steps.variables.outputs.test_report_path }}
@ -272,3 +302,6 @@ runs:
test_all_session_file: ${{ steps.global.outputs.test_all_session_file }}
btest_session_file: ${{ steps.global.outputs.btest_session_file }}
test_spec_session_file: ${{ steps.global.outputs.test_spec_session_file }}
test_all_subset_input_file: ${{ steps.global.outputs.test_all_subset_input_file }}
btest_subset_input_file: ${{ steps.global.outputs.btest_subset_input_file }}
test_spec_subset_input_file: ${{ steps.global.outputs.test_spec_subset_input_file }}