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

Respect --no-run-tests, --no-run-benchmarks when listing actions #6643

Closed
mpilgrem opened this issue Aug 11, 2024 · 0 comments
Closed

Respect --no-run-tests, --no-run-benchmarks when listing actions #6643

mpilgrem opened this issue Aug 11, 2024 · 0 comments

Comments

@mpilgrem
Copy link
Member

mpilgrem commented Aug 11, 2024

The motivation of:

taken together, was to allow a user to specify configuration:

build:
  test: true
  test-arguments:
    no-run-tests: true
  bench: true
  benchmark-opts:
    no-run-benchmarks: true
notify-if-no-run-tests: false
notify-if-no-run-benchmarks: false

such that stack build (after stack build) could appear be an 'no op'. Such a user could command stack build --run-tests, if they wished for test suites of project packages to be run.

However, consider a simple two-project package (packageA, packageB) each with two test suites (1 and 2) and two benchmarks (1 and 2). The second stack build yields:

Completed 4 action(s).

The four actions in question are the running of test suites and benchmarks for each of two project packages; these actions do nothing because --no-run-tests and --no-run-benchmarks.

With notification restored, the output is:

packageA> Test running disabled by --no-run-tests flag.
packageB> Test running disabled by --no-run-tests flag.
packageA> Benchmark running disabled by --no-run-benchmarks flag.
packageB> Benchmark running disabled by --no-run-benchmarks flag.
Completed 4 action(s).

I propose that --no-run-tests and --no-run-benchmarks should be respected when the list of actions is created, as opposed to when the list of actions that has been created is subsequently executed.

After the change, with notification restored, the output is (but in colour):

All test running disabled by --no-run-tests flag. To mute this message in future, set
notify-if-no-run-tests: false in Stack's configuration.
All benchmark running disabled by --no-run-benchmarks flag. To mute this message in future, set
notify-if-no-run-benchmarks: false in Stack's configuration.

After the change, with notification disabled, the second stack build is the desired 'no op'.

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

No branches or pull requests

1 participant