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

Run all tests with user-specified runner #1046

Merged
merged 8 commits into from
Jun 22, 2024

Conversation

perazz
Copy link
Contributor

@perazz perazz commented Jun 6, 2024

Fix #1041

@urbanjost what do you think?

@perazz
Copy link
Contributor Author

perazz commented Jun 10, 2024

Summary of updated behavior:

fpm run --example     -> do not run - dump available names
fpm run               -> do not run - dump available names
fpm test              -> *run all*
fpm run --example '*' -> run all
fpm test '*'          -> run all
fpm run '*'           -> run all
fpm run '*' --runner 'time'           -> run all
fpm run --example '*' --runner 'time' -> run all 
fpm test '*' --runner 'time'          -> run all

cc: @gnikit @henilp105 @fortran-lang/fpm @jacobwilliams @urbanjost

@perazz
Copy link
Contributor Author

perazz commented Jun 16, 2024

@jacobwilliams @lockstockandbarrel there are no outstanding comments. So I will wait for one or two days, and then merge.

@gnikit
Copy link
Member

gnikit commented Jun 16, 2024

Summary of updated behavior:

fpm run --example     -> do not run - dump available names
fpm run               -> do not run - dump available names
fpm test              -> *run all*
fpm run --example '*' -> run all
fpm test '*'          -> run all
fpm run '*'           -> run all
fpm run '*' --runner 'time'           -> run all
fpm run --example '*' --runner 'time' -> run all 
fpm test '*' --runner 'time'          -> run all

@perazz is this list of commands and actions up to date?

@perazz
Copy link
Contributor Author

perazz commented Jun 17, 2024

@gnikit exactly

@gnikit
Copy link
Member

gnikit commented Jun 19, 2024

Ok cool. Then I have some thoughts on this, about name expectations and ease of use. I'll try and post them later today.

@gnikit
Copy link
Member

gnikit commented Jun 19, 2024

The only thing that doesn't sit right with me is that

  • fpm run
  • fpm run --example and
  • fpm test

describe actions running and testing, but when one does fpm run they actually get a list. IMHO this is inconsistent with what a user would expect.
For me the behaviour of test and run (with/out --examples) should be consistent.

Command Result
fpm run Run all apps
fpm run --examples Run all examples
fpm test Run all tests

Usage of --all / '*' should also run all, although the --all option is somewhat redundant now (I would still keep it).
Usage of --runner should not affect the target selection, e.g. fpm run and fpm run --runner 'time' should both run all targets
To get a list of the available targets one should do: fpm run --list, fpm run --example --list or fpm test --list.

These are my 2cents @perazz and @urbanjost let me know what you think.

@perazz
Copy link
Contributor Author

perazz commented Jun 20, 2024

The former logic was: you wanted to run all tests (simple programs) by default to ease CI runs, while if you have many apps or examples, in general you should know what you're trying to run (they should be more complete programs etc.)

However, I also like the consistency approach.

Copy link
Member

@gnikit gnikit left a comment

Choose a reason for hiding this comment

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

LGTM, nice work @perazz

@urbanjost
Copy link
Contributor

urbanjost commented Jun 20, 2024 via email

@perazz
Copy link
Contributor Author

perazz commented Jun 22, 2024

@urbanjost thanks, there's a lot of ideas here. I will merge this PR as they deserve separate investigation.

I like these two the most:

running by globbing is supported. Should regex be allowed too?

getting a tally of program exit codes, particularly for test (allowing it to act as a unit test framework)

@perazz perazz merged commit 06cdf47 into fortran-lang:main Jun 22, 2024
20 checks passed
@perazz perazz deleted the runner_all_tests branch June 22, 2024 16:38
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.

fpm test with --runner
3 participants