Skip to content

install_test.py: append to install-time test log for multiple test phases#50477

Merged
tldahlgren merged 11 commits intospack:developfrom
AlexanderRichert-NOAA:append_install_test_log_may25
Oct 17, 2025
Merged

install_test.py: append to install-time test log for multiple test phases#50477
tldahlgren merged 11 commits intospack:developfrom
AlexanderRichert-NOAA:append_install_test_log_may25

Conversation

@AlexanderRichert-NOAA
Copy link
Copy Markdown
Contributor

@AlexanderRichert-NOAA AlexanderRichert-NOAA commented May 14, 2025

This PR is a proposed solution for #49200, where currently 'make installcheck' output overwrites 'make test'/'make check' output for autotools and makefile (and possibly other) packages. This PR modifies install_test.py to append to install-time-test-log.txt instead of overwriting when it's logged to by both check() and installcheck(). This in turn is achieved by allowing llnl/util/tty/log.py:log_output() to append to existing files.

I wouldn't mind if the check() output went to a different file from installcheck(), but I would ideally like some working solution sooner than later.

Fixes #49200

@spackbot-app spackbot-app bot added core PR affects Spack core functionality tests General test capability(ies) labels May 14, 2025
@AlexanderRichert-NOAA AlexanderRichert-NOAA force-pushed the append_install_test_log_may25 branch from 6dcb9db to 62c1042 Compare May 14, 2025 23:06
@AlexanderRichert-NOAA
Copy link
Copy Markdown
Contributor Author

@spackbot fix style

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented May 14, 2025

Let me see if I can fix that for you!

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented May 14, 2025

I was able to run spack style --fix for you!

spack style --fix
==> Running style checks on spack
  selected: import, isort, black, flake8, mypy
==> Modified files
  lib/spack/spack/install_test.py
  lib/spack/spack/test/install_test.py
  var/spack/test_repos/builtin.mock/packages/dummy-makefile-build-test-log/package.py
==> Running import checks
lib/spack/spack/test/install_test.py: missing import: spack.main (spack.main.SpackCommand)
  import found errors
==> Running isort checks
Fixing /tmp/tmpd20pbly9/spack/lib/spack/spack/test/install_test.py
  isort checks were clean
==> Running black checks
All done! ✨ 🍰 ✨
3 files left unchanged.
  black checks were clean
==> Running flake8 checks
  flake8 checks were clean
==> Running mypy checks
Success: no issues found in 646 source files
  mypy checks were clean
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I've updated the branch with style fixes.

@AlexanderRichert-NOAA AlexanderRichert-NOAA marked this pull request as draft May 15, 2025 01:27
@AlexanderRichert-NOAA
Copy link
Copy Markdown
Contributor Author

@spackbot fix style

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented May 16, 2025

Let me see if I can fix that for you!

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented May 16, 2025

I was able to run spack style --fix for you!

spack style --fix
==> Running style checks on spack
  selected: import, isort, black, flake8, mypy
==> Modified files
  lib/spack/llnl/util/tty/log.py
  lib/spack/spack/install_test.py
  lib/spack/spack/test/install_test.py
  var/spack/test_repos/builtin.mock/packages/dummy-makefile-build-test-log/package.py
==> Running import checks
  import checks were clean
==> Running isort checks
  isort checks were clean
==> Running black checks
reformatted lib/spack/llnl/util/tty/log.py
reformatted lib/spack/spack/install_test.py
All done! ✨ 🍰 ✨
2 files reformatted, 2 files left unchanged.
  black checks were clean
==> Running flake8 checks
  flake8 checks were clean
==> Running mypy checks
Success: no issues found in 646 source files
  mypy checks were clean
==> spack style checks were clean
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I've updated the branch with style fixes.

@AlexanderRichert-NOAA AlexanderRichert-NOAA marked this pull request as ready for review May 16, 2025 19:39
@tldahlgren
Copy link
Copy Markdown
Contributor

Please resolve the conflicts then ping me.

@AlexanderRichert-NOAA AlexanderRichert-NOAA force-pushed the append_install_test_log_may25 branch from f7838bf to 12dad84 Compare August 21, 2025 02:31
@AlexanderRichert-NOAA AlexanderRichert-NOAA force-pushed the append_install_test_log_may25 branch from 12dad84 to a651554 Compare August 21, 2025 02:33
@AlexanderRichert-NOAA
Copy link
Copy Markdown
Contributor Author

Thanks @tldahlgren, please take another look

Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

The core changes work. I have requested paring down the unit test-related changes. (See comments.)

@AlexanderRichert-NOAA AlexanderRichert-NOAA force-pushed the append_install_test_log_may25 branch from e4e2ae0 to e323835 Compare October 15, 2025 23:21
tldahlgren
tldahlgren previously approved these changes Oct 16, 2025
Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@AlexanderRichert-NOAA
Copy link
Copy Markdown
Contributor Author

@tldahlgren I ran into the issues with windows that I did before, so I'm omitting the new cmd/install.py test functionality for win32.

Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

Please use pytest.mark.skipif() instead to skip the unit test on windows.

This will allow the unit-test to be flagged the output as a special case.

Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

Thanks!

@tldahlgren
Copy link
Copy Markdown
Contributor

@AlexanderRichert-NOAA
Copy link
Copy Markdown
Contributor Author

Dang, I thought I had the auto-signoff enabled. Thanks

@tldahlgren tldahlgren enabled auto-merge (squash) October 17, 2025 21:44
@tldahlgren tldahlgren merged commit cdb2edf into spack:develop Oct 17, 2025
31 checks passed
AlexanderRichert-NOAA added a commit to AlexanderRichert-NOAA/spack that referenced this pull request Oct 23, 2025
…ases (spack#50477)

* Append to install-time test log for multiple test phases

Signed-off-by: Alex Richert <[email protected]>

* log.py: fix tmp dir arg

Signed-off-by: Alex Richert <[email protected]>

* log.py: fix typo (:)

Signed-off-by: Alex Richert <[email protected]>

* use existing tests/pkg

Signed-off-by: Alex Richert <[email protected]>

* remove new test file/pkg

Signed-off-by: Alex Richert <[email protected]>

* test/cmd/install.py: skip log append check for win32

Signed-off-by: Alex Richert <[email protected]>

* test/cmd/install.py: skip install 'tests' for win32

Signed-off-by: Alex Richert <[email protected]>

* test/cmd/install.py: fix install test-skip logic (win32)

Signed-off-by: Alex Richert <[email protected]>

* test/cmd/install.py: skip test_package_output for windows

Signed-off-by: Alex Richert <[email protected]>

* Revert "test/cmd/install.py: skip test_package_output for windows"

This reverts commit f14beed.

Signed-off-by: Alex Richert <[email protected]>

---------

Signed-off-by: Alex Richert <[email protected]>
climbfuji added a commit to JCSDA/spack that referenced this pull request Oct 24, 2025
install_test.py: append to install-time test log for multiple test phases (spack#50477)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality new-version tests General test capability(ies) utilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check() output overwritten by installcheck()

2 participants