From: Ricardo Martincoski Date: Sun, 21 Oct 2018 23:35:39 -0300 Subject: [Buildroot] [PATCH] .gitlab-ci.yml: do runtime tests only on explicit trigger References: <277d5a7f-c605-af13-c004-63259faa649a@mind.be> Message-ID: <5bcd377bb2a67_2682ab89f25c7b81143d@ultri5.mail> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Hello, On Sun, Oct 21, 2018 at 08:23 AM, Arnout Vandecappelle wrote: [snip] >>> .runtime_test: &runtime_test >>> + # Running the runtime tests for every push is too much, so limit to >>> + # explicit triggers through the API. >>> + only: >>> + - triggers >>> + - tags >> >> We could also allow a regexp on the branch name to trigger it: >> - /^.*-runtime_test$/ >> >> Using the same commit, I pushed 2 branches: >> branch name: gitlabci-triggers, #jobs = 4 >> https://gitlab.com/RicardoMartincoski/buildroot/pipelines/33723520 >> branch name: gitlabci-triggers-runtime_test, #jobs = 72 >> https://gitlab.com/RicardoMartincoski/buildroot/pipelines/33723541 > > Looks nice, but that's really material for a separate patch (and probably Indeed. > should be done for defconfigs too then). OK. > > Would it be possible to also define branches for a specific test or defconfig? Yes. Using the same commit, I pushed 3 branches and a tag: git push gitlab HEAD:test2 #jobs = 4 https://gitlab.com/RicardoMartincoski/buildroot/pipelines/33765315 git push gitlab HEAD:test2-TestSyslogNg #jobs = 5 https://gitlab.com/RicardoMartincoski/buildroot/pipelines/33765342 git push gitlab HEAD:test2-runtime_test #jobs = 72 https://gitlab.com/RicardoMartincoski/buildroot/pipelines/33765317 git push gitlab test2-tag #jobs = 260 https://gitlab.com/RicardoMartincoski/buildroot/pipelines/33765321 We will need some extra 'sed' trickery to create a regexp for each test case: -tests.package.test_syslog_ng.TestSyslogNg: *runtime_test +tests.package.test_syslog_ng.TestSyslogNg: + <<: *runtime_test + only: + - triggers + - tags + - /^.*-runtime_test$/ + - /^.*-TestSyslogNg$/ Unfortunately the inheritance using the anchor runtime_test does not allow to merge two 'only' keywords, the 'only' declared on the test case key overrides entirely the 'only' declared on the hidden key '.runtime_test' (or the other way around if << is placed@the end), so we would need to repeat those lines for every test case listed. But maybe we don't care that .gitlab-ci.yml grows because those lines would be automatically generated by 'make .gitlab-ci.yml'. > > Could you take care of this? Sure. Regards, Ricardo