Skip to content

Commit 16a755b

Browse files
authored
Merge branch 'easybuilders:develop' into allow_try_for_multi_tc
2 parents b9f33ea + 850b7fd commit 16a755b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2097
-338
lines changed

.github/workflows/container_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-22.04
1515
strategy:
1616
matrix:
17-
python: [2.7, 3.7]
17+
python: [3.7]
1818
fail-fast: false
1919
steps:
2020
- uses: actions/checkout@v3
2121

2222
- name: set up Python
23-
uses: actions/setup-python@v3
23+
uses: actions/setup-python@v4
2424
with:
2525
python-version: ${{matrix.python}}
2626
architecture: x64

.github/workflows/container_tests_apptainer.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
runs-on: ubuntu-22.04
1515
strategy:
1616
matrix:
17-
python: [2.7, 3.7]
17+
python: [3.7]
1818
apptainer: [1.0.0, 1.1.7]
1919
fail-fast: false
2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v3
2222

2323
- name: set up Python
24-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v3
2525
with:
2626
python-version: ${{matrix.python}}
2727
architecture: x64

.github/workflows/eb_command.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-20.04
1515
strategy:
1616
matrix:
17-
python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
17+
python: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
1818
fail-fast: false
1919
steps:
2020
- uses: actions/checkout@v3
2121

2222
- name: set up Python
23-
uses: actions/setup-python@v3
23+
uses: actions/setup-python@v4
2424
with:
2525
python-version: ${{matrix.python}}
2626
architecture: x64

.github/workflows/end2end.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: End-to-end test of EasyBuild in different distros
2+
on: [push, pull_request]
3+
jobs:
4+
build_publish:
5+
name: End-to-end test
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
container:
10+
- centos-7.9
11+
- centos-8.5
12+
- fedora-36
13+
- opensuse-15.4
14+
- rockylinux-8.8
15+
- rockylinux-9.2
16+
- ubuntu-20.04
17+
- ubuntu-22.04
18+
fail-fast: false
19+
container:
20+
image: ghcr.io/easybuilders/${{ matrix.container }}-amd64
21+
steps:
22+
- name: Check out the repo
23+
uses: actions/checkout@v3
24+
25+
- name: download and unpack easyblocks and easyconfigs repositories
26+
run: |
27+
cd $HOME
28+
for pkg in easyblocks easyconfigs; do
29+
curl -OL https://github.com/easybuilders/easybuild-${pkg}/archive/develop.tar.gz
30+
tar xfz develop.tar.gz
31+
rm -f develop.tar.gz
32+
done
33+
34+
- name: Set up environment
35+
shell: bash
36+
run: |
37+
# collect environment variables to be set in subsequent steps in script that can be sourced
38+
echo "export PATH=$PWD:$PATH" > /tmp/eb_env
39+
echo "export PYTHONPATH=$PWD:$HOME/easybuild-easyblocks-develop:$HOME/easybuild-easyconfigs-develop" >> /tmp/eb_env
40+
41+
- name: Run commands to check test environment
42+
shell: bash
43+
run: |
44+
cmds=(
45+
"whoami"
46+
"pwd"
47+
"env | sort"
48+
"eb --version"
49+
"eb --show-system-info"
50+
"eb --check-eb-deps"
51+
"eb --show-config"
52+
)
53+
for cmd in "${cmds[@]}"; do
54+
echo ">>> $cmd"
55+
sudo -u easybuild bash -l -c "source /tmp/eb_env; $cmd"
56+
done
57+
58+
- name: End-to-end test of installing bzip2 with EasyBuild
59+
shell: bash
60+
run: |
61+
sudo -u easybuild bash -l -c "source /tmp/eb_env; eb bzip2-1.0.8.eb --trace --robot"

.github/workflows/linting.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-20.04
1414
strategy:
1515
matrix:
16-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
16+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
1717

1818
steps:
1919
- uses: actions/checkout@v3
2020

2121
- name: set up Python
22-
uses: actions/setup-python@v3
22+
uses: actions/setup-python@v4
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

.github/workflows/unit_tests.yml

Lines changed: 35 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-20.04
2626
strategy:
2727
matrix:
28-
python: [2.7, 3.6]
28+
python: [3.6]
2929
modules_tool:
3030
# use variables defined by 'setup' job above, see also
3131
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
@@ -34,54 +34,32 @@ jobs:
3434
- ${{needs.setup.outputs.modulesTcl}}
3535
- ${{needs.setup.outputs.modules3}}
3636
- ${{needs.setup.outputs.modules4}}
37-
module_syntax: [Lua, Tcl]
3837
lc_all: [""]
39-
# don't test with Lua module syntax (only supported in Lmod)
40-
exclude:
41-
- modules_tool: ${{needs.setup.outputs.modulesTcl}}
42-
module_syntax: Lua
43-
- modules_tool: ${{needs.setup.outputs.modules3}}
44-
module_syntax: Lua
45-
- modules_tool: ${{needs.setup.outputs.modules4}}
46-
module_syntax: Lua
4738
include:
48-
# Test different Python 3 versions with Lmod 8.x (with both Lua and Tcl module syntax)
39+
# Test different Python 3 versions with Lmod 8.x
4940
- python: 3.5
5041
modules_tool: ${{needs.setup.outputs.lmod8}}
51-
module_syntax: Lua
5242
- python: 3.7
5343
modules_tool: ${{needs.setup.outputs.lmod8}}
54-
module_syntax: Lua
5544
- python: 3.8
5645
modules_tool: ${{needs.setup.outputs.lmod8}}
57-
module_syntax: Lua
58-
- python: 3.8
59-
modules_tool: ${{needs.setup.outputs.lmod8}}
60-
module_syntax: Tcl
6146
- python: 3.9
6247
modules_tool: ${{needs.setup.outputs.lmod8}}
63-
module_syntax: Lua
6448
- python: '3.10'
6549
modules_tool: ${{needs.setup.outputs.lmod8}}
66-
module_syntax: Lua
67-
- python: '3.11'
68-
modules_tool: ${{needs.setup.outputs.lmod8}}
69-
module_syntax: Lua
7050
- python: '3.11'
7151
modules_tool: ${{needs.setup.outputs.lmod8}}
72-
module_syntax: Tcl
7352
# There may be encoding errors in Python 3 which are hidden when an UTF-8 encoding is set
7453
# Hence run the tests (again) with LC_ALL=C and Python 3.6 (or any < 3.7)
7554
- python: 3.6
7655
modules_tool: ${{needs.setup.outputs.lmod8}}
77-
module_syntax: Lua
7856
lc_all: C
7957
fail-fast: false
8058
steps:
8159
- uses: actions/checkout@v3
8260

8361
- name: set up Python
84-
uses: actions/setup-python@v3
62+
uses: actions/setup-python@v4
8563
with:
8664
python-version: ${{matrix.python}}
8765
architecture: x64
@@ -125,16 +103,11 @@ jobs:
125103
# and are only run after the PR gets merged
126104
GITHUB_TOKEN: ${{secrets.CI_UNIT_TESTS_GITHUB_TOKEN}}
127105
run: |
128-
# don't install GitHub token when testing with Lmod 7.x or non-Lmod module tools,
129-
# and only when testing with Lua as module syntax,
130-
# to avoid hitting GitHub rate limit;
106+
# only install GitHub token when testing with Lmod 8.x + Python 3.6 or 3.9, to avoid hitting GitHub rate limit;
131107
# tests that require a GitHub token are skipped automatically when no GitHub token is available
132-
if [[ ! "${{matrix.modules_tool}}" =~ 'Lmod-7' ]] && [[ ! "${{matrix.modules_tool}}" =~ 'modules-' ]] && [[ "${{matrix.module_syntax}}" == 'Lua' ]]; then
108+
if [[ "${{matrix.modules_tool}}" =~ 'Lmod-8' ]] && [[ "${{matrix.python}}" =~ 3.[69] ]]; then
133109
if [ ! -z $GITHUB_TOKEN ]; then
134-
if [ "x${{matrix.python}}" == 'x2.6' ];
135-
then SET_KEYRING="keyring.set_keyring(keyring.backends.file.PlaintextKeyring())";
136-
else SET_KEYRING="import keyrings.alt.file; keyring.set_keyring(keyrings.alt.file.PlaintextKeyring())";
137-
fi;
110+
SET_KEYRING="import keyrings.alt.file; keyring.set_keyring(keyrings.alt.file.PlaintextKeyring())";
138111
python -c "import keyring; $SET_KEYRING; keyring.set_password('github_token', 'easybuild_test', '$GITHUB_TOKEN')";
139112
fi
140113
echo "GitHub token installed!"
@@ -172,8 +145,6 @@ jobs:
172145
- name: run test suite
173146
env:
174147
EB_VERBOSE: 1
175-
EASYBUILD_MODULE_SYNTAX: ${{matrix.module_syntax}}
176-
TEST_EASYBUILD_MODULE_SYNTAX: ${{matrix.module_syntax}}
177148
LC_ALL: ${{matrix.lc_all}}
178149
run: |
179150
# run tests *outside* of checked out easybuild-framework directory,
@@ -198,23 +169,32 @@ jobs:
198169
else
199170
export EASYBUILD_MODULES_TOOL=Lmod
200171
fi
201-
export TEST_EASYBUILD_MODULES_TOOL=$EASYBUILD_MODULES_TOOL
202-
eb --show-config
203-
# gather some useful info on test system
204-
eb --show-system-info
205-
# check GitHub configuration
206-
eb --check-github --github-user=easybuild_test
207-
# create file owned by root but writable by anyone (used by test_copy_file)
208-
sudo touch /tmp/file_to_overwrite_for_easybuild_test_copy_file.txt
209-
sudo chmod o+w /tmp/file_to_overwrite_for_easybuild_test_copy_file.txt
210-
# silence deprecation warning when using Python 2, since it breaks a bunch of tests
211-
if [ "${{matrix.python}}" == '2.7' ]; then
212-
export TEST_EASYBUILD_SILENCE_DEPRECATION_WARNINGS=python2
213-
fi
214-
# run test suite
215-
python -O -m test.framework.suite 2>&1 | tee test_framework_suite.log
216-
# try and make sure output of running tests is clean (no printed messages/warnings)
217-
IGNORE_PATTERNS="no GitHub token available|skipping SvnRepository test|requires Lmod as modules tool|stty: 'standard input': Inappropriate ioctl for device|CryptographyDeprecationWarning: Python 3.[56]|from cryptography.* import |CryptographyDeprecationWarning: Python 2|Blowfish|GC3Pie not available, skipping test"
218-
# '|| true' is needed to avoid that Travis stops the job on non-zero exit of grep (i.e. when there are no matches)
219-
PRINTED_MSG=$(egrep -v "${IGNORE_PATTERNS}" test_framework_suite.log | grep '\.\n*[A-Za-z]' || true)
220-
test "x$PRINTED_MSG" = "x" || (echo "ERROR: Found printed messages in output of test suite" && echo "${PRINTED_MSG}" && exit 1)
172+
export TEST_EASYBUILD_MODULES_TOOL=${EASYBUILD_MODULES_TOOL}
173+
174+
# Run tests with LUA and Tcl module syntax (where supported)
175+
for module_syntax in Lua Tcl; do
176+
# Only Lmod supports Lua
177+
if [[ "${module_syntax}" == "Lua" ]] && [[ "${EASYBUILD_MODULES_TOOL}" != "Lmod" ]]; then
178+
echo "Not testing with '${module_syntax}' as module syntax with '${EASYBUILD_MODULES_TOOL}' as modules tool"
179+
continue
180+
fi
181+
printf '\n\n=====================> Using $module_syntax module syntax <=====================\n\n'
182+
export EASYBUILD_MODULE_SYNTAX="${module_syntax}"
183+
export TEST_EASYBUILD_MODULE_SYNTAX="${EASYBUILD_MODULE_SYNTAX}"
184+
185+
eb --show-config
186+
# gather some useful info on test system
187+
eb --show-system-info
188+
# check GitHub configuration
189+
eb --check-github --github-user=easybuild_test
190+
# create file owned by root but writable by anyone (used by test_copy_file)
191+
sudo touch /tmp/file_to_overwrite_for_easybuild_test_copy_file.txt
192+
sudo chmod o+w /tmp/file_to_overwrite_for_easybuild_test_copy_file.txt
193+
# run test suite
194+
python -O -m test.framework.suite 2>&1 | tee test_framework_suite.log
195+
# try and make sure output of running tests is clean (no printed messages/warnings)
196+
IGNORE_PATTERNS="no GitHub token available|skipping SvnRepository test|requires Lmod as modules tool|stty: 'standard input': Inappropriate ioctl for device|CryptographyDeprecationWarning: Python 3.[56]|from cryptography.* import |CryptographyDeprecationWarning: Python 2|Blowfish|GC3Pie not available, skipping test"
197+
# '|| true' is needed to avoid that GitHub Actions stops the job on non-zero exit of grep (i.e. when there are no matches)
198+
PRINTED_MSG=$(egrep -v "${IGNORE_PATTERNS}" test_framework_suite.log | grep '\.\n*[A-Za-z]' || true)
199+
test "x$PRINTED_MSG" = "x" || (echo "ERROR: Found printed messages in output of test suite" && echo "${PRINTED_MSG}" && exit 1)
200+
done
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
2+
name: EasyBuild framework unit tests (python2)
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read # to fetch code (actions/checkout)
7+
8+
concurrency:
9+
group: ${{format('{0}:{1}:{2}', github.repository, github.ref, github.workflow)}}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test_python2:
14+
runs-on: ubuntu-20.04
15+
container:
16+
# CentOS 7.9 container that already includes Lmod & co,
17+
# see https://github.com/easybuilders/easybuild-containers
18+
image: ghcr.io/easybuilders/centos-7.9-amd64
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- name: install Python packages
23+
run: |
24+
# Python packages
25+
python2 -V
26+
python2 -m pip --version
27+
python2 -m pip install --upgrade pip
28+
python2 -m pip --version
29+
# strip out GC3Pie since installation with ancient setuptools (0.9.8) fails
30+
sed -i '/GC3Pie/d' requirements.txt
31+
python2 -m pip install -r requirements.txt
32+
# git config is required to make actual git commits (cfr. tests for GitRepository)
33+
sudo -u easybuild git config --global user.name "GitHub Actions"
34+
sudo -u easybuild git config --global user.email "[email protected]"
35+
sudo -u easybuild git config --get-regexp 'user.*'
36+
37+
- name: install GitHub token (if available)
38+
env:
39+
# token (owned by @boegelbot) with gist permissions (required for some of the tests for GitHub integration);
40+
# this token is not available in pull requests, so tests that require it are skipped in PRs,
41+
# and are only run after the PR gets merged
42+
GITHUB_TOKEN: ${{secrets.CI_UNIT_TESTS_GITHUB_TOKEN}}
43+
run: |
44+
# tests that require a GitHub token are skipped automatically when no GitHub token is available
45+
if [ ! -z $GITHUB_TOKEN ]; then
46+
sudo -u easybuild python2 -c "import keyring; import keyrings.alt.file; keyring.set_keyring(keyrings.alt.file.PlaintextKeyring()); keyring.set_password('github_token', 'easybuild_test', '$GITHUB_TOKEN')";
47+
echo "GitHub token installed!"
48+
else
49+
echo "Installation of GitHub token skipped!"
50+
fi
51+
52+
- name: install sources
53+
run: |
54+
# install from source distribution tarball, to test release as published on PyPI
55+
python2 setup.py sdist
56+
ls dist
57+
export PREFIX=/tmp/$USER/$GITHUB_SHA
58+
python2 -m pip install --prefix $PREFIX dist/easybuild-framework*tar.gz
59+
60+
- name: run test suite
61+
run: |
62+
# run tests *outside* of checked out easybuild-framework directory,
63+
# to ensure we're testing installed version (see previous step)
64+
cd $HOME
65+
# make sure 'eb' is available via $PATH, and that $PYTHONPATH is set (some tests expect that)
66+
export PREFIX=/tmp/$USER/$GITHUB_SHA
67+
ENV_CMDS="export PATH=$PREFIX/bin:$PATH; export PYTHONPATH=$PREFIX/lib/python2.7/site-packages:$PYTHONPATH"
68+
ENV_CMDS="${ENV_CMDS}; export EB_VERBOSE=1; export EB_PYTHON=python2; export TEST_EASYBUILD_SILENCE_DEPRECATION_WARNINGS=python2"
69+
# run EasyBuild command via (non-root) easybuild user + login shell
70+
sudo -u easybuild bash -l -c "${ENV_CMDS}; module --version; eb --version"
71+
# show active EasyBuild configuration
72+
sudo -u easybuild bash -l -c "${ENV_CMDS}; eb --show-config"
73+
# gather some useful info on test system
74+
sudo -u easybuild bash -l -c "${ENV_CMDS}; eb --show-system-info"
75+
# check GitHub configuration
76+
sudo -u easybuild bash -l -c "${ENV_CMDS}; eb --check-github --github-user=easybuild_test"
77+
# create file owned by root but writable by anyone (used by test_copy_file)
78+
sudo touch /tmp/file_to_overwrite_for_easybuild_test_copy_file.txt
79+
sudo chmod o+w /tmp/file_to_overwrite_for_easybuild_test_copy_file.txt
80+
# run test suite (via easybuild user + login shell)
81+
sudo -u easybuild bash -l -c "${ENV_CMDS}; python2 -O -m test.framework.suite"

0 commit comments

Comments
 (0)