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

Backport #10320: Convert validate.sh to a Haskell script #10490

Merged
merged 15 commits into from
Oct 30, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 29, 2024

Closes #10317.

A Haskell script will be easier to maintain and expand than the existing Bash script.

This also adds a --pattern PATTERN option which lets you filter tests across all test suites.

I've kept the new script's behavior as close to the old script's behavior as possible, to reduce design discussion on this PR.

TODO

  • Add cabal-validate/README.md to make it obvious where to look for logic and how to interact with the program
  • Add Haddock comments to most definitions

Future work

  • It should be possible to override the default tasty args (currently --hide-successes)
  • --list-steps only lists the steps that are enabled with the given command-line options, not all possible steps; ./validate.sh --list-steps and ./validate.sh --list-steps --run-cli-suite give different results! (This is an existing bug in the old script.)
  • Perhaps "steps" should be divided into "suites"; for example, the lib-tests step runs five different test suites, making it take much longer than necessary to reproduce test failures.
  • Commands printed to users should be shell escaped. (Exiting bug in the old script.)
  • --help output could use some love; it wasn't very clear to me what various commands do.
  • --keep-going mode to ignore failures and continue executing tests/suites.
  • The output is really verbose, because the command lines are so long.
    This is an automatic backport of pull request Convert validate.sh to a Haskell script #10320 done by Mergify.

Closes #10317.

A Haskell script will be easier to maintain and expand than the existing
Bash script.

This also adds a `--pattern PATTERN` option which lets you filter tests
across all test suites.

(cherry picked from commit 582a5c7)

# Conflicts:
#	validate.sh
This disentangles the utility boilerplate from the validation logic,
making the `Main.hs` module much easier to read and modify.

(cherry picked from commit 43a3975)
(cherry picked from commit 96d6ad5)
(cherry picked from commit 9f5d90f)
(cherry picked from commit a10a2a3)
(cherry picked from commit 92613f0)
This seems to fix an error where `long-tests` isn't built?

(cherry picked from commit d208282)
(cherry picked from commit 1900d5e)
Copy link
Contributor Author

mergify bot commented Oct 29, 2024

Cherry-pick of 582a5c7 has failed:

On branch mergify/bp/3.12/pr-10320
Your branch is up to date with 'origin/3.12'.

You are currently cherry-picking commit 582a5c747.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   Makefile
	new file:   cabal-validate/cabal-validate.cabal
	new file:   cabal-validate/main/Main.hs
	modified:   project-cabal/pkgs/tests.config

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   validate.sh

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts label Oct 29, 2024
@mergify mergify bot mentioned this pull request Oct 29, 2024
2 tasks
@mergify mergify bot added the backport label Oct 29, 2024
@geekosaur geekosaur added the squash+merge me Tell Mergify Bot to squash-merge label Oct 30, 2024
@mergify mergify bot merged commit 86a8e2c into 3.12 Oct 30, 2024
47 checks passed
@mergify mergify bot deleted the mergify/bp/3.12/pr-10320 branch October 30, 2024 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport squash+merge me Tell Mergify Bot to squash-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants