Skip to content

Stand-alone testing: Make recipe support and processing spack-/pytest-like#34236

Merged
alalazo merged 68 commits intospack:developfrom
tldahlgren:spack_test_refactor
May 10, 2023
Merged

Stand-alone testing: Make recipe support and processing spack-/pytest-like#34236
alalazo merged 68 commits intospack:developfrom
tldahlgren:spack_test_refactor

Conversation

@tldahlgren
Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren commented Dec 1, 2022

fixes #35519

This PR is a refactor of Spack's stand-alone test process to be more spack- and pytest-like. It is more spack-like in that test parts are no longer "hidden" in a package's run_test() method and pytest-like in that any package method whose name starts test_ (i.e., a "test" method) is a test part. We also support the ability to embed test parts in a test method when that makes sense.

Test methods are now implicit test parts. The docstring is the purpose for the test part. The name of the method is the name of the test part. The working directory is the active spec's test stage directory. You can embed test parts using the test_part context manager.

This PR adds other functionality (in part because it was originally tested here).

PR highlights:

@spackbot-app spackbot-app bot added commands core PR affects Spack core functionality labels Dec 1, 2022
@tldahlgren tldahlgren changed the title Stand-alone testing: Make recipe support and processing more like pytest Stand-alone testing: Make recipe support and processing pytest-like Dec 1, 2022
@spackbot-app spackbot-app bot added build-systems stand-alone-tests Stand-alone (or smoke) tests for installed packages build-environment tests General test capability(ies) python update-package labels Dec 3, 2022
@spackbot-app spackbot-app bot added the documentation Improvements or additions to documentation label Jan 19, 2023
@tldahlgren tldahlgren force-pushed the spack_test_refactor branch 8 times, most recently from 7fb0118 to 97c7cbf Compare January 24, 2023 19:09
tldahlgren added 26 commits May 9, 2023 15:07
Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

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

I think we are ready to merge this one. We can keep a close eye on issues that may arise in the forthcoming days, in case we need some minor fixup to follow. For the record I just tested openmpi with both the current setup and with #35802 and it works correctly.

@tldahlgren
Copy link
Copy Markdown
Contributor Author

I think we are ready to merge this one. We can keep a close eye on issues that may arise in the forthcoming days, in case we need some minor fixup to follow. For the record I just tested openmpi with both the current setup and with #35802 and it works correctly.

Great! I'm inclined to start working on the follow-on test PRs (i.e., confirming they work and making adjustments as needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-environment build-systems commands core PR affects Spack core functionality dependencies documentation Improvements or additions to documentation maintainers new-version python stand-alone-tests Stand-alone (or smoke) tests for installed packages tests General test capability(ies) update-package virtual-dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spack test: Spec.package can only be called on concrete specs

3 participants