Skip to content

Cleanup integration tests for stack repl #6740

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

Merged
merged 13 commits into from
May 19, 2025

Conversation

ulidtko
Copy link
Contributor

@ulidtko ulidtko commented May 16, 2025

Overhaul of integration tests that exercise stack repl, gets them to run, and pass, on all matrix platforms (windows, too). Resolves #6170.

Glossing over various cleanups and refactorings (full details in commit messages), highlights of changes:

  • eliminated threadDelay-driven "synchronization" in test logic;
  • fixed missing EOF signalling on the child process' stdin at test finalization — resolving a -- TODO: Understand why the exit code is 1 despite running GHCi tests successfully;
  • added logging of ghci's stderr on exceptions in test code — resolving a visibility issue / improving debuggability;
  • byte-by-byte shuttling of stderr contents replaced with an FD redirect — yielding noticeable speed-up (in repl tests only);
  • added -ignore-dot-ghci — its absence was causing failures in local runs on my machine.

Removed stubs that disable repl tests on windows, introduced in the wake of #6170 (PR #6174). They run again.

Test scenarios themselves kept intact; besides simplifications and cleanups, no logical change in asserts.

Tested via local runs, and CI spins in my fork. I got 5 consecutive runs 🟢 passing all 5 matrix jobs, on the same code (modulo rebases over updates in master). The repl tests are definitely running, and apparently stable.

Checklist:

  • Get CI green 🟢
  • Any changes that could be relevant to users have been recorded in ChangeLog.md.
    • not touching much beyond tests/, no need
  • The documentation has been updated, if necessary

@ulidtko ulidtko force-pushed the maint/repl-tests branch 2 times, most recently from c63aeb3 to 07c2223 Compare May 17, 2025 15:49
@ulidtko ulidtko changed the title WIP: cleanup integration tests for stack repl Cleanup integration tests for stack repl May 17, 2025
@ulidtko ulidtko marked this pull request as ready for review May 17, 2025 19:07
@ulidtko
Copy link
Contributor Author

ulidtko commented May 17, 2025

Hi @mpilgrem, this is ready for review, please take a look.

@mpilgrem
Copy link
Member

mpilgrem commented May 18, 2025

You'll see from the 'linting' CI that Hlint has a suggestion. There are exceptions (see .hlint.yaml and .hlint-test.yaml) but, for the most part, the Stack project takes up what Hlint suggests.

The checking-in of the three stack.yaml.lock files are my past mistake. I've now deleted them from the master branch.

@mpilgrem
Copy link
Member

@ulidtko, thanks. Looks good to me. You've not allowed edits from maintainers, otherwise I would have put through the small stuff/rebased directly. I've made some observations.

@ulidtko ulidtko force-pushed the maint/repl-tests branch from 07c2223 to 84f857d Compare May 19, 2025 07:03
@ulidtko ulidtko requested a review from mpilgrem May 19, 2025 07:04
@ulidtko ulidtko force-pushed the maint/repl-tests branch from 84f857d to 3a939d5 Compare May 19, 2025 07:05
@ulidtko
Copy link
Contributor Author

ulidtko commented May 19, 2025

@mpilgrem comments addressed & rebased. Maintainer edits allowed, too.

@mpilgrem mpilgrem merged commit 4e9396c into commercialhaskell:master May 19, 2025
13 checks passed
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.

Move from msys2-20221216 to msys2-20230526 adversely affects some tests
2 participants