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

rework tests to show summary (sections) #58

Closed
wants to merge 1 commit into from

Conversation

t-bltg
Copy link
Contributor

@t-bltg t-bltg commented Jan 23, 2023

Per #53 (comment).

Rework tests to use the default Test package instead of TestItemRunner (I don't see the added value of using this dependency), allowing to show the @testset description while running the tests, thus categorizing stdout into clear sections.

Not doing so is confusing especially when a test is failing because the failing test output is mixed with the CondaPkg / μmamba output from a previous non-failing test.

Example output:

[...]
Test Summary:  | Pass  Total     Time
add/rm package |    3      3  1m40.4s
    CondaPkg Found dependencies: /tmp/jl_vtam3r/CondaPkg.toml
    CondaPkg Dependencies already up to date
    CondaPkg Dependencies already up to date
Test Summary:  | Pass  Total  Time
add/rm channel |    2      2  0.7s
[...]

@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Merging #58 (7fdc54f) into main (4ecd7a2) will decrease coverage by 0.67%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
- Coverage   87.66%   87.00%   -0.67%     
==========================================
  Files           7        7              
  Lines         900      900              
==========================================
- Hits          789      783       -6     
- Misses        111      117       +6     
Impacted Files Coverage Δ
src/env.jl 94.82% <0.00%> (-1.73%) ⬇️
src/resolve.jl 91.61% <0.00%> (-1.45%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@cjdoris
Copy link
Collaborator

cjdoris commented Jan 23, 2023

I want to keep the @testitems - they allow you to run individual tests from VSCode, which I use a lot.

You may be able to achieve a similar effect by simply printing the name at the start of a test item. It may even be possible to programmatically get the name of the enclosing test item, I don't know.

@t-bltg
Copy link
Contributor Author

t-bltg commented Jan 23, 2023

You may be able to achieve a similar effect by simply printing the name at the start of a test item

I wanted to avoid the redundancy of the test name.

It may even be possible to programmatically get the name of the enclosing test item, I don't know.

Yeah, writing a macro, don't know if that will enhance clarity.

@cjdoris
Copy link
Collaborator

cjdoris commented Jan 26, 2023

I want to keep the @testitem functionality, so won't be merging this as-is. Are you going to look at other ways to separate the output, or shall I close this for now?

@t-bltg
Copy link
Contributor Author

t-bltg commented Jan 27, 2023

I tried implementing something else without success, TestItemRunner is problematic IMO.

I leave this to your appreciation, but I really think splitting the tests stdout into sections is needed (maybe adding a print is sufficient, but the redundancy with the @testitem test name makes it a typical job for a macro for clarity).

@t-bltg t-bltg closed this Jan 27, 2023
@t-bltg t-bltg deleted the test_name branch January 27, 2023 12:04
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.

2 participants