os-autoinst-distri-opensuse icon indicating copy to clipboard operation
os-autoinst-distri-opensuse copied to clipboard

Reduce execution of compile tests by checking changed files only

Open rfan1 opened this issue 1 year ago • 9 comments

  • Related ticket: https://progress.opensuse.org/issues/124688

  • Verification run: n/a Now only changed files are checked export PERL5LIB=../..:os-autoinst:lib:tests/installation:tests/x11:tests/qa_automation:tests/virt_autotest:tests/cpu_bugs:tests/sles4sap/saptune:$PERL5LIB: ; for f in git diff --name-only | grep '.pm' ; do perl -c $f 2>&1 | grep -v " OK$" && exit 2; done ; true

rfan1 avatar Mar 01 '23 03:03 rfan1

I'd argue that the test should check all files to prevent that we're accidentally missing out some files and thus this should not be changed. Isn't also the CI using this test? If so, this change might reduce the overall coverage and introduce the possibility of missing out some files, that should be checked.

IMHO test-compile-changed is an additional convenience function to be executed locally only.

grisu48 avatar Mar 01 '23 08:03 grisu48

I'd argue that the test should check all files to prevent that we're accidentally missing out some files and thus this should not be changed. Isn't also the CI using this test? If so, this change might reduce the overall coverage and introduce the possibility of missing out some files, that should be checked.

IMHO test-compile-changed is an additional convenience function to be executed locally only.

We can do this for PRs and keep the longer running one for the merges

foursixnine avatar Mar 01 '23 09:03 foursixnine

We can do this for PRs and keep the longer running one for the merges

This introduces the risk that failures in master will not be attended for long but I think that's an acceptable risk

okurz avatar Mar 01 '23 09:03 okurz

Should also this line be changed? ->

https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/bebe56bb31c8baa9f4ee7e71c9adb105ac7d399b/Makefile#L118 ?

done

rfan1 avatar Mar 01 '23 11:03 rfan1

Thanks all for the kindly feedback.

I will hold on this PR due to some risks

rfan1 avatar Mar 02 '23 01:03 rfan1

You can just follow the suggestion in https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16497#issuecomment-1449668278 to have the "changed" target called in GitHub actions for pull requests, the complete one otherwise. I suggest to look into the GitHub workflow file

okurz avatar Mar 02 '23 06:03 okurz

You can just follow the suggestion in #16497 (comment) to have the "changed" target called in GitHub actions for pull requests, the complete one otherwise. I suggest to look into the GitHub workflow file

Sure, will do

rfan1 avatar Mar 02 '23 07:03 rfan1

@foursixnine Seems it is hard to define the different job for ci check for both push and pull_request, so I create a new file

rfan1 avatar Mar 03 '23 04:03 rfan1

Based on the CI check result, comile tests at pull_request phase is Required that we can skip it. ci / CI: Running compile tests with perl v5.26 (pull_request) Successful in 14m Required

We may need change the default required workflow [I don't have the permission to do this] https://docs.github.com/en/actions/using-workflows/required-workflows

rfan1 avatar Mar 06 '23 08:03 rfan1