From e3c217296d89b19ed3b8c189edcf3dbc7c0df3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 21 May 2020 11:33:11 +0200 Subject: [PATCH 1/4] Do not install Python packages in GitLab CI jobs As Python QA tools, BIND system test prerequisites, and documentation building utilities are now all included in operating system images used in GitLab CI, do not use pip for installing them in each CI job any more. --- .gitlab-ci.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f47a8262b..6f904cf2af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -199,7 +199,6 @@ stages: before_script: - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}" - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}" - - pip3 install pytest requests || pip install pytest requests || true script: - *configure - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1 @@ -257,7 +256,6 @@ stages: before_script: - *setup_interfaces - *setup_softhsm - - pip3 install pytest requests || pip install pytest requests || true script: - cd bin/tests/system - make -j${TEST_PARALLEL_JOBS:-1} -k check V=1 || make -j${TEST_PARALLEL_JOBS:-1} -k recheck V=1 @@ -429,8 +427,6 @@ flake8: needs: - job: autoreconf artifacts: true - before_script: - - pip3 install flake8 script: - *configure - flake8 --max-line-length=80 $(git ls-files '*.py' | grep -v 'ans\.py') @@ -444,12 +440,9 @@ pylint: needs: - job: autoreconf artifacts: true - before_script: - - pip3 install pylint - - PYTHONPATH="$PYTHONPATH:$CI_PROJECT_DIR/bin/python" - - pip3 install pytest requests || pip install pytest requests script: - *configure + - PYTHONPATH="$PYTHONPATH:$CI_PROJECT_DIR/bin/python" - pylint --rcfile $CI_PROJECT_DIR/.pylintrc $(git ls-files '*.py' | grep -v 'ans\.py') only: - merge_requests @@ -478,8 +471,6 @@ docs: before_script: - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}" - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}" - - pip3 install pytest requests || pip install pytest requests || true - - pip3 install sphinx sphinx_rtd_theme || pip install sphinx sphinx_rtd_theme - apt -yqqq update - apt -yqqq dist-upgrade - apt -yqqq install texlive-full texlive-xetex latexmk xindy From 62b8a5e59d556e80c55574667b14ae4a8509f308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 21 May 2020 11:33:11 +0200 Subject: [PATCH 2/4] Do not install doc build tools in GitLab CI jobs As documentation building utilities are now all included in operating system images used in GitLab CI, do not install them in each "docs" CI job any more. --- .gitlab-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f904cf2af..92e9d713ba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -471,9 +471,6 @@ docs: before_script: - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}" - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}" - - apt -yqqq update - - apt -yqqq dist-upgrade - - apt -yqqq install texlive-full texlive-xetex latexmk xindy script: - *configure - make -j${BUILD_PARALLEL_JOBS:-1} -k maintainer-clean V=1 From 5562c38ffb33da7f074dbe796a21124fe1ecf9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 21 May 2020 11:33:11 +0200 Subject: [PATCH 3/4] Do not use f-strings in Python system tests Use str.format() instead of f-strings in Python system tests to enable them to work on Python 3 versions older than 3.6 as the latter is not available on some operating systems used in GitLab CI that are still actively supported (CentOS 6, Debian 9, Ubuntu 16.04). --- bin/tests/system/statschannel/helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tests/system/statschannel/helper.py b/bin/tests/system/statschannel/helper.py index 7b53e9e9fe..ba6cf70134 100644 --- a/bin/tests/system/statschannel/helper.py +++ b/bin/tests/system/statschannel/helper.py @@ -79,9 +79,9 @@ def zone_mtime(zonedir, name): def zone_keyid(nameserver, zone, key): - with open(f'{nameserver}/{zone}.{key}.id') as f: + with open('{}/{}.{}.id'.format(nameserver, zone, key)) as f: keyid = f.read().strip() - print(f'{zone}-{key} ID: {keyid}') + print('{}-{} ID: {}'.format(zone, key, keyid)) return keyid From d5562a3e7e9edf6d5ff8a7873f15dea42edb1fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 21 May 2020 11:33:11 +0200 Subject: [PATCH 4/4] Add py.test-3 to the list of tested pytest names Some operating systems (e.g. CentOS, OpenBSD) install the main pytest script as "py.test-3". Add that name to the list of names passed to AC_PATH_PROGS() in order for pytest to be properly detected on a broader range of operating systems. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 680645c565..d9a9c528f5 100644 --- a/configure.ac +++ b/configure.ac @@ -280,7 +280,7 @@ AM_CONDITIONAL([HAVE_PERLMOD_TIME_HIRES], AM_PATH_PYTHON([3.4], [], [:]) AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ":"]) -AC_PATH_PROGS([PYTEST], [pytest-3 pytest pytest-pypy], []) +AC_PATH_PROGS([PYTEST], [pytest-3 py.test-3 pytest pytest-pypy], []) AS_IF([test -z "$PYTEST"], [AC_MSG_WARN([pytest not found, some system tests will be skipped])]) AC_SUBST([PYTEST])