Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite improvements #3790

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Jul 30, 2021

Extracted some parts of #3780

Major change: Running the suite now allows to pass any valid unittest args, such as -k for filtering or --verbose for more detailed output (really missed that in #3780) similar to easybuilders/easybuild-easyconfigs@17379db in the EC repo

@Flamefire
Copy link
Contributor Author

I remember something about 9d04087
The "proper" way just marks the test as skipped and hence is no longer caught by the filtered output check. I.e. previously if a test was skipped it would print something to stdout which the later check would find and fail CI. This no longer works (this way).

So maybe the check should look for skipped tests? Or just ignore this for now...

@boegel
Copy link
Member

boegel commented Nov 13, 2021

These changes break the way we're currently filtering tests from test.framework.suite, which we should try and avoid:

$ python3 -m test.framework.suite load
E
======================================================================
ERROR: load (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: module '__main__' has no attribute 'load'

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)

This is supposed to filter all tests down to just the ones that include load in the test name...

@Flamefire
Copy link
Contributor Author

Flamefire commented Nov 13, 2021

These changes break the way we're currently filtering tests from test.framework.suite, which we should try and avoid:

But they allow the proper way: python3 -m test.framework.suite -k load should work which it did not before especially for the non-standard way of adding subtests. See e.g. 4e0a269

Edit: BTW: The failing test is due to a faulty usage env_file = open(reprod_dumpenv, "r").read().
Replace this by read_file to avoid the resource leak (missing close for open)

@boegel
Copy link
Member

boegel commented Nov 15, 2021

These changes break the way we're currently filtering tests from test.framework.suite, which we should try and avoid:

But they allow the proper way: python3 -m test.framework.suite -k load should work which it did not before especially for the non-standard way of adding subtests. See e.g. 4e0a269

OK, but can we somehow automagically translate python3 -m test.framework.suite load to python3 -m test.framework.suite -k load, to ensure both work?

Many people are used to filtering tests by just passing a pattern, and this still works for the individual subsuites:

python3 -m test.framework.modules load

(so does -k load here)

@Flamefire
Copy link
Contributor Author

OK, but can we somehow automagically translate python3 -m test.framework.suite load to python3 -m test.framework.suite -k load, to ensure both work?

Not sure. I'm afraid that would be hacky and could be ambiguous and/or break things. As far as I can tell this way now is the "correct" way (i.e. as documented by unittest) so if people now have to pass an additional -k I guess they'll manage ;) How many are running the EB test suite anyway? And if we have to decide between having access to (all) the regular unittest flags or this little backwards compat thing I'd say the change is well worth it

@boegel boegel modified the milestones: 4.5.1, release after 4.5.1 Dec 7, 2021
@boegel boegel modified the milestones: 4.5.2, release after 4.5.2 Jan 14, 2022
@boegel boegel modified the milestones: 4.5.3, release after 4.5.3 Feb 8, 2022
The pip-installable pysvn is incomplete and the full one is not easy to install.
Simply return if `$TEST_EASYBUILD_MODULES_TOOL` is not set to Lmod.
This avoids any "skip" output on CI
For PRs silently skip the tests when no token is available else use a skip.
On GHA force enable the tests when the source repo is 'easybuilds' so a
token is expected to be available.
As that is used a lot use that for better describing the purpose.
GC3Pie on Python 3.11 does not work: gc3pie/gc3pie#674
So avoid the skip mark for that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants