From 5419774b23ef231216fd9c37c63ff83620c9faf3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 11 Sep 2020 11:22:10 +1200 Subject: [PATCH] autobuild: Remove the os.getpid() from the autobuild directory This might help our CI runners get a ccache hit by keeping the path constant. Otherwise, we only get a good ccache hit rate if the docker container gives us the same pid each time. Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- .gitlab-ci.yml | 18 +++++++++--------- script/autobuild.py | 7 ++++++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ae83acf2a5..b622396609b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -113,7 +113,7 @@ include: # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the # autobuild name, which means we can define a default template that runs most autobuild jobs - echo "Running cmd script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase" - - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase + - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase # Ensure when adding a new job below that you also add it to # the dependencies for 'pages' below for the code coverage page @@ -122,14 +122,14 @@ include: others: extends: .shared_template script: - - script/autobuild.py ldb $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase - - script/autobuild.py pidl $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase - - script/autobuild.py replace $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase - - script/autobuild.py talloc $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase - - script/autobuild.py tdb $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase - - script/autobuild.py tevent $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase - - script/autobuild.py samba-xc $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase - - script/autobuild.py docs-xml $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase + - script/autobuild.py ldb $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/ldb + - script/autobuild.py pidl $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/pidl + - script/autobuild.py replace $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/replace + - script/autobuild.py talloc $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/talloc + - script/autobuild.py tdb $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/tdb + - script/autobuild.py tevent $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/tevent + - script/autobuild.py samba-xc $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/samba-xc + - script/autobuild.py docs-xml $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/docs-xml samba: extends: .shared_template diff --git a/script/autobuild.py b/script/autobuild.py index 89699826e62..a54d4206958 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -56,6 +56,8 @@ parser.add_option("--keeplogs", help="keep logs", default=False, action="store_t parser.add_option("--nocleanup", help="don't remove test tree", default=False, action="store_true") parser.add_option("--testbase", help="base directory to run tests in (default %s)" % def_testbase, default=def_testbase) +parser.add_option("--full-testbase", help="full base directory to run tests in (default %s/b$PID)" % def_testbase, + default=None) parser.add_option("--passcmd", help="command to run on success", default=None) parser.add_option("--verbose", help="show all commands as they are run", default=False, action="store_true") @@ -97,7 +99,10 @@ if options.retry: if options.rebase is None: raise Exception('You can only use --retry if you also rebase') -testbase = "%s/b%u" % (options.testbase, os.getpid()) +if options.full_testbase is not None: + testbase = options.full_testbase +else: + testbase = "%s/b%u" % (options.testbase, os.getpid()) test_master = "%s/master" % testbase test_prefix = "%s/prefix" % testbase test_tmpdir = "%s/tmp" % testbase -- 2.34.1