Bonjour, Here is more concrete example that should work in GitHub (it runs in GitLab): https://lab.fedeproxy.eu/ceph/ceph/-/blob/wip-backports/src/test/run-ceph-backport-tests.sh if ! git diff --stat ${GITHUB_BASE:=origin/master}..${GITHUB_SHA:=HEAD} | grep -q $SCRIPT ; then echo SKIP because $SCRIPT is not modified exit 0 fi and it will be triggered from: https://lab.fedeproxy.eu/ceph/ceph/-/blob/wip-backports/src/test/CMakeLists.txt#L611 add_ceph_test(run-ceph-backport-tests.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-ceph-backport-tests.sh) Cheers On 24/08/2021 11:06, Loïc Dachary wrote: > Hi Neha, > > On 18/08/2021 19:52, Neha Ojha wrote: >> On Tue, Aug 10, 2021 at 5:52 AM Loïc Dachary <loic@xxxxxxxxxxx> wrote: >>> >>> Bonjour, >>> >>> The ceph-backport.sh is used on a regular basis by developers helping with backports: it proved to be stable and robust over the years. Minimal integration tests were added[0] this week to minimize the risk of a regression when improving it, for instance to help with the ordering of backports[1]. The test environment[2] spawns a redmine instance configured in the same way as https://tracker.ceph.com/ and a Gitea instance that has the same API as GitHub[3] with repositories configured in the same way as https://github.com/ceph/ceph/. >>> >>> I think it would make sense to include the tests in the CI[4]. The test itself would do nothing if the PR does not contain any change related to ceph-backport.sh. Does that sound sensible? >> >> I don't see any issues with it given that the tests would only run for >> changes touching ceph-backport.sh. I am not very clear on how the >> tests will be integrated with the CI, can you please elaborate? > > It would be something like: > > new file src/script/test-ceph-backport.sh > @@ -0,0 +1,8 @@ > +#!/bin/bash > + > +if git $current_pr stats | grep ceph-backport.sh ; then > + git clone https://lab.fedeproxy.eu/ceph/ceph-backport > + cd ceph-backport > + tests/setup.sh # launches a redmine and a gitea in docker containers > + tests/test-ceph-backport.sh > +fi > modified src/test/CMakeLists.txt > @@ -591,6 +591,8 @@ add_ceph_test(run-cli-tests ${CMAKE_CURRENT_SOURCE_DIR}/run-cli-tests) > > add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh) > > +add_ceph_test(test-ceph-backport.sh ${CMAKE_CURRENT_SOURCE_DIR}/test-ceph-backport.sh) > + > find_program(PROMTOOL_EXECUTABLE promtool) > if(PROMTOOL_EXECUTABLE) > execute_process( > > Of course it is less than ideal to have a dependency on a third party repository and the following steps would be to gradually move what is in https://lab.fedeproxy.eu/ceph/ceph-backport into the source tree so that it is self contained. The dependencies are python and docker. > > I hope that answers your question :-) > > Cheers > >> >> Thanks, >> Neha >> >> >>> >>> Cheers >>> >>> [0] https://tracker.ceph.com/issues/51222 >>> [1] https://tracker.ceph.com/issues/51224 >>> [2] https://lab.fedeproxy.eu/ceph/ceph-backport/ >>> [3] https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#api-v1 >>> [4] https://tracker.ceph.com/issues/52122 >>> -- >>> Loïc Dachary, Artisan Logiciel Libre >>> >>> _______________________________________________ >>> Dev mailing list -- dev@xxxxxxx >>> To unsubscribe send an email to dev-leave@xxxxxxx >> > -- Loïc Dachary, Artisan Logiciel Libre _______________________________________________ Dev mailing list -- dev@xxxxxxx To unsubscribe send an email to dev-leave@xxxxxxx