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

Add euint --test flag #2684

Merged
merged 1 commit into from
Feb 23, 2022
Merged

Add euint --test flag #2684

merged 1 commit into from
Feb 23, 2022

Conversation

eproxus
Copy link
Contributor

@eproxus eproxus commented Feb 23, 2022

This PR adds a -t, --test flag to the eunit task to be able to run individual test cases.

You can now run individual tests like this:

$ rebar3 eunit --test=module1:func1+func2,module2:func1;func2
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling app
===> Performing EUnit tests...
....
Finished in 0.019 seconds
4 tests, 0 failures

+ is added as a test case separator for the same module since ; is problematic to use in shells by default.

Thanks @ferd and @richcarl for pointers on how to implement this.

Review Questions

  • Does it make sense to align with CT flags? (In my opinion, not)
  • Is + okay as an additional delimiter (also to --generator)?
  • Did some minor refactoring, let me know if you want that removed (or split into multiple commits/PRs)
  • Should documentation updates be part of this PR or to another repo?

@eproxus eproxus force-pushed the eproxus/eunit-test-flag branch from f54b658 to ba2a15e Compare February 23, 2022 10:48
@ferd
Copy link
Collaborator

ferd commented Feb 23, 2022

Nice.

  1. no need to align with CT flags, the tools are sufficiently different that this is very hard to align -- CT has issues where running a single test may or may not rely on a nested list of groups above them, and we willingly keep the CLI set distinct and more aligned with the underlying framework than a generalized testing experience.
  2. Adding the separator is a good idea, few or no functions should contain the + in them anyway
  3. the refactoring seems fine
  4. the help commands (rebar3 help <command> or manpages) are updated automatically from this (I'll just need to run regen at some point), but we do have manually maintained documentation in https://github.com/tsloughter/rebar3.org/ for the website, so a follow-up PR for it could be nice.

@eproxus
Copy link
Contributor Author

eproxus commented Feb 23, 2022

macOS tests randomly failed, probably need a re-run (I've seen this before on GitHub Actions 😮‍💨).

@ferd
Copy link
Collaborator

ferd commented Feb 23, 2022

yeah there's something flaky about the filesystem in the OSX container, this is sadly more or less expected.

@ferd ferd merged commit 76039f9 into erlang:main Feb 23, 2022
@eproxus eproxus deleted the eproxus/eunit-test-flag branch February 23, 2022 15:28
ferd added a commit that referenced this pull request Jun 18, 2022
New features:

- [Add --offline option and REBAR_OFFLINE environment variable](#2643)
- [Add support for project-local plugins](#2697)
- [Add eunit --test flag](#2684)

Experimental features for which we promise no backwards compatibility in
the near future:

- [Experimental vendoring provider](#2689)
  - [Support plugins in experimental vendor provider](#2702)

Other changes:

- [Support OTP 23..25 inclusively](#2706)
- [Bump Relx to 4.7.0](#2718)
  - [Use `erlexec` directly in relx helper functions](erlware/relx#902)
  - [Make rlx_util:parse_vsn parse integer versions](erlware/relx#913)
  - [fix awk script check_name() in extended_bin](erlware/relx#915)
  - [avoid crash when overlay is malformed](erlware/relx#916)
  - [keep attributes when stripping beams](erlware/relx#906)
  - [Fix {include_erts,true} in Windows releases](erlware/relx#914)
  - [ensure the erl file is writable before copying dyn_erl to it](erlware/relx#903)
  - Various tests added
- [Properly carry overlay_vars settings for files in relx](#2711)
- [Track mib compilation artifacts](#2709)
- [Attempt to find apps in git subdirs (sparse checkouts)](#2687)
- [Do not discard parameters --system_libs and --include-erts when duplicate values exist](#2695)
- [Use default `depth` parameter for SSL](#2690)
- [Fix global cache config overriding](#2683)
- [Error out on unknown templates in 'new' command](#2676)
- [Fix a typo](#2674)
- [Bump certifi to 2.9.0](#2673)
- [add a debug message in internal dependency fetching code](#2672)
- [Use SPDX id for license in template and test](#2668)
- [Use default branch for git and git_subdir resources with no revision](#2663)

Signed-off-by: Fred Hebert <[email protected]>
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.

3 participants