-
Notifications
You must be signed in to change notification settings - Fork 46
/
tox.ini
135 lines (121 loc) · 7.53 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
[tox]
minversion = 3.20
envlist = lint, py{27, 36, 37, 38, 39, 310, 311, 312, 313}, darwin
[gh-actions]
# The "lint" job is run separately.
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313
[testenv:lint]
# Warning: This environment inherits settings from the main [testenv] section.
description = run code linters
basepython = python3
allowlist_externals =
find
deps =
flake8
pylint
changedir = {toxinidir}
commands =
# stop the build if there are Python syntax errors or undefined names
flake8 . --config {toxinidir}/.flake8 --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --config {toxinidir}/.flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
#find . -name .git -prune -false -o -name .tox -prune -false -o -iname '*.py' \
# -exec pylint -j 0 --rcfile {toxinidir}/.pylintrc \{\} +
#pylint -j 0 --rcfile .pylintrc aliBuild aliDeps aliDoctor pb
[testenv]
description = run test suite under {envname}
# Commands we can call that aren't installed in the tox virtualenv.
allowlist_externals =
sh
git
test
touch
sl
rm
deps =
coverage
distro
setenv =
# `aliBuild analytics` puts preference files under $HOME.
HOME = {envtmpdir}
# Keep coverage info for later upload, if needed. Files in {envtmpdir} are
# deleted after each run.
COVERAGE_FILE = {toxworkdir}/coverage.{envname}
ARCHITECTURE = slc7_x86-64
darwin: ARCHITECTURE = osx_x86-64
changedir = {envtmpdir}
commands =
# The first coverage command shouldn't have an -a, so we completely replace
# the coverage info from the last run.
coverage run --source={toxinidir} {toxinidir}/aliBuild analytics off
test -e .config/alibuild/disable-analytics
test ! -e .config/alibuild/analytics-uuid
coverage run --source={toxinidir} -a {toxinidir}/aliBuild analytics on
test ! -e .config/alibuild/disable-analytics
test -e .config/alibuild/analytics-uuid
coverage run --source={toxinidir} -a {toxinidir}/aliBuild analytics off
test -e .config/alibuild/disable-analytics
test -e .config/alibuild/analytics-uuid
coverage run --source={toxinidir} -a {toxinidir}/aliBuild version
coverage run --source={toxinidir} -a -m unittest discover {toxinidir}/tests
git clone -b O2-v1.3.0 --depth 1 https://github.com/alisw/alidist
coverage run --source={toxinidir} -a {toxinidir}/aliBuild -a {env:ARCHITECTURE} -z test-init init zlib
# This command is expected to fail, but run it for the coverage anyway.
# A leading "-" means tox ignores the exit code.
- coverage run --source={toxinidir} -a {toxinidir}/aliBuild build non-existing -a {env:ARCHITECTURE} --no-system --disable GCC-Toolchain
# TODO: do we need these? This seems to be at least partially covered by
# unit tests in tests/tests_parseRecipe.py.
sh -c 'coverage run --source={toxinidir} -a {toxinidir}/aliBuild -c {toxinidir}/tests/testdist build broken1 --force-unknown-architecture --no-system --disable GCC-Toolchain 2>&1 | tee /dev/stderr | grep "Header missing"'
sh -c 'coverage run --source={toxinidir} -a {toxinidir}/aliBuild -c {toxinidir}/tests/testdist build broken2 --force-unknown-architecture --no-system --disable GCC-Toolchain 2>&1 | tee /dev/stderr | grep "Empty recipe"'
sh -c 'coverage run --source={toxinidir} -a {toxinidir}/aliBuild -c {toxinidir}/tests/testdist build broken3 --force-unknown-architecture --no-system --disable GCC-Toolchain 2>&1 | tee /dev/stderr | grep "Unable to parse"'
sh -c 'coverage run --source={toxinidir} -a {toxinidir}/aliBuild -c {toxinidir}/tests/testdist build broken4 --force-unknown-architecture --no-system --disable GCC-Toolchain 2>&1 | tee /dev/stderr | grep "Malformed header"'
sh -c 'coverage run --source={toxinidir} -a {toxinidir}/aliBuild -c {toxinidir}/tests/testdist build broken5 --force-unknown-architecture --no-system --disable GCC-Toolchain 2>&1 | tee /dev/stderr | grep "Missing package"'
sh -c 'coverage run --source={toxinidir} -a {toxinidir}/aliBuild -c {toxinidir}/tests/testdist build broken6 --force-unknown-architecture --no-system --disable GCC-Toolchain 2>&1 | tee /dev/stderr | grep "while scanning a quoted scalar"'
sh -c 'coverage run --source={toxinidir} -a {toxinidir}/aliBuild -c {toxinidir}/tests/testdist build broken7 --force-unknown-architecture --no-system --disable GCC-Toolchain 2>&1 | tee /dev/stderr | grep "Malformed entry prefer_system"'
# Make sure that etc/profile.d/init.sh is re-written properly, even if the package build overwrites it.
# In particular, AliEn-Runtime does this, so we must handle this.
sh -c 'coverage run --source={toxinidir} -a {toxinidir}/aliBuild -c {toxinidir}/tests/testdist build clobber-initdotsh -a {env:ARCHITECTURE} --no-system --no-remote-store >&2 && WORK_DIR=$PWD/sw . sw/{env:ARCHITECTURE}/clobber-initdotsh/1-local1/etc/profile.d/init.sh'
# AliRoot-OCDB deletes $INSTALLROOT/etc/ during build, so make sure we can handle that fine too.
sh -c 'coverage run --source={toxinidir} -a {toxinidir}/aliBuild -c {toxinidir}/tests/testdist build delete-etc -a {env:ARCHITECTURE} --no-system --no-remote-store >&2 && WORK_DIR=$PWD/sw . sw/{env:ARCHITECTURE}/delete-etc/1-local1/etc/profile.d/init.sh'
coverage run --source={toxinidir} -a {toxinidir}/aliBuild build zlib -a {env:ARCHITECTURE} --no-system --disable GCC-Toolchain
alienv -a {env:ARCHITECTURE} q
alienv -a {env:ARCHITECTURE} setenv zlib/latest -c bash -c '[[ $LD_LIBRARY_PATH == */zlib/* ]]'
coverage run --source={toxinidir} -a {toxinidir}/aliBuild -a {env:ARCHITECTURE} doctor AliPhysics
coverage run --source={toxinidir} -a {toxinidir}/aliBuild -a {env:ARCHITECTURE} build zlib --dry-run
py311: coverage run --source={toxinidir} -a {toxinidir}/aliBuild --aggressive-cleanup --docker -a slc7_x86-64 --always-prefer-system -d build zlib
# Test for devel packages
coverage run --source={toxinidir} -a {toxinidir}/aliBuild init zlib
py311: coverage run --source={toxinidir} -a {toxinidir}/aliBuild --aggressive-cleanup --docker -a slc7_x86-64 --always-prefer-system -d build zlib
# Test that we complain if we have a devel package with an untracked file
coverage run --source={toxinidir} -a {toxinidir}/aliBuild init zlib
touch zlib/foo
coverage run --source={toxinidir} -a {toxinidir}/aliBuild -a {env:ARCHITECTURE} --no-system --disable GCC-Toolchain build zlib
coverage run --source={envsitepackagesdir} -a -m unittest discover {toxinidir}/tests
# On Darwin we also test sapling support
darwin: sl clone https://github.com/alisw/alidist alidist-sapling
darwin: coverage run --source={toxinidir} -a {toxinidir}/aliBuild -a {env:ARCHITECTURE} -c alidist-sapling --no-system --disable GCC-Toolchain build zlib
darwin: rm -fr zlib
darwin: sl clone https://github.com/alisw/zlib
darwin: coverage run --source={toxinidir} -a {toxinidir}/aliBuild -a {env:ARCHITECTURE} --no-system --disable GCC-Toolchain build zlib
touch zlib/foo
darwin: coverage run --source={toxinidir} -a {toxinidir}/aliBuild -a {env:ARCHITECTURE} --no-system --disable GCC-Toolchain build zlib
[coverage:run]
branch = True
include =
*/alibuild*/*
*/.tox/*/lib/*/alibuild_helpers/*
[coverage:report]
exclude_lines =
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
# Don't complain if non-runnable code isn't run:
if __name__ == .__main__.: