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

Improve find_modules with regex functionality #81

Merged
merged 7 commits into from
Sep 5, 2023

Conversation

casparvl
Copy link
Collaborator

@casparvl casparvl commented Aug 25, 2023

Expand functionality of find_modules so that it can be passed a regular expression. It can also ommit the version (i.e. anything after the last slash) from the match, if required.

If you want to define a ReFrame test to play around with the new find_modules functionality:

# eessi/tests/find_modules.py
import reframe as rfm
import reframe.utility.sanity as sn

from eessi.testsuite import hooks, utils
from eessi.testsuite.constants import *

@rfm.simple_test
class find_modules(rfm.RunOnlyRegressionTest):

    # This test can run at any scale, so parameterize over all known SCALES
    valid_prog_environs = ['default']
    valid_systems = ['*']

    # Parameterize over all modules that start with X
    module_name = parameter(utils.find_modules('^gompi\/', name_only = False))

    executable = 'hostname'

    time_limit = '5m'

    # This test should be run as part of EESSI CI
    tags = {TAGS['CI']}

Then run with e.g.

reframe -C test-suite/config/izum_vega.py -c test-suite/eessi/testsuite/tests/find_modules.py -R -t CI -l

This also makes me think: do we need unittests for the test suite? I.e. tests that test the hooks & utils? It might be difficult to make some of those, e.g. how do we convince the ReFrame runtimes available_modules to return us a predetermined set of modules? But it would be worthwhile to have, as it defines the desired behaviour. It would also be very valuable for things like: does filtering work (which tests should run on which partitions), how many MPI ranks & OpenMP threads are launched, etc.

Caspar van Leeuwen added 2 commits August 25, 2023 16:42
…ar expression. It can also ommit the version (i.e. anything after the last slash) from the match, if required.
eessi/testsuite/utils.py Outdated Show resolved Hide resolved
eessi/testsuite/utils.py Outdated Show resolved Hide resolved
eessi/testsuite/utils.py Show resolved Hide resolved
Forward slash does not need to be escaped

Co-authored-by: Sam Moors <[email protected]>
@casparvl casparvl requested a review from smoors August 28, 2023 15:54
eessi/testsuite/utils.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@smoors smoors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested and works fine (after removing the trailing slash with name_only=True, see comment).

eessi/testsuite/utils.py Outdated Show resolved Hide resolved
eessi/testsuite/utils.py Outdated Show resolved Hide resolved
eessi/testsuite/utils.py Show resolved Hide resolved
@casparvl casparvl requested a review from smoors September 5, 2023 15:02
Copy link
Collaborator

@smoors smoors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@smoors smoors merged commit 39bf58f into EESSI:main Sep 5, 2023
9 checks passed
@boegel boegel added this to the 0.1.0 milestone Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants