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

Added console-lines output mode which prints each test on a separate line #443

Merged
merged 2 commits into from Jan 7, 2024

Conversation

smuuf
Copy link
Contributor

@smuuf smuuf commented Aug 12, 2023

Usage example:

$ ./src/tester -C -o console-lines tests/

This is handy for environments with "non-standard" (buffered, I guess?) handling of standard output, for example Github Actions (where a progress of tests cannot be seen until until end-of-line appears, which in standard console mode happens only when all tests finish) or Docker Compose logging output (where in standard console mode each finished test's dot is printed alone on separate line).

Or the console-lines mode can be handy just to see a more detailed progress of tests in all environments, because it outputs something like this:

Passing tests Failing tests Usage Also supports "cider mode"

obrazek

obrazek

obrazek

obrazek

Also, "cider mode" now shows a lemon emoji for skipped tests.

smuuf added a commit to smuuf/docs that referenced this pull request Aug 12, 2023
@smuuf smuuf changed the base branch from master to v1.x August 12, 2023 10:54
@smuuf smuuf changed the base branch from v1.x to master August 12, 2023 10:54
@smuuf smuuf changed the title Implemented console-lines mode which prints each test on a separate line Added console-lines output mode which prints each test on a separate line Aug 12, 2023
@dg
Copy link
Member

dg commented Aug 12, 2023

I like that!

I'd probably just use a slightly different name, like -o verbose?

@smuuf
Copy link
Contributor Author

smuuf commented Aug 12, 2023

I'd think verbose could mean different things for different output modes, so maybe usurping the word verbose for something related just to the console output might not be the best thing to do, future-wise, but other than that I have no strong opinion on that 😄

So if you'd prefer verbose, I can make it be called verbose.

@smuuf smuuf changed the title Added console-lines output mode which prints each test on a separate line Added verbose output mode which prints each test on a separate line Aug 12, 2023
smuuf added a commit to smuuf/docs that referenced this pull request Aug 12, 2023
@smuuf
Copy link
Contributor Author

smuuf commented Aug 12, 2023

Updated: Renamed to verbose + updated the relevant PR to docs.

@dg
Copy link
Member

dg commented Aug 12, 2023

I was just throwing that out there, I'm sure someone can think of something better.

@MartinMystikJonas
Copy link
Contributor

Imho 'console-lines' was better. Or just 'lines'?

@smuuf
Copy link
Contributor Author

smuuf commented Aug 14, 2023

I think the word console, as the output is still meant for console/terminal, should be contained in the mode's name.

So for now I changed it back to console-lines. If anyone has some other suggestion, feel free to propose it.

…ine.

This is handy for environments with non-standard (buffered) handling of
standard output, for example Github Actions (where a progress of tests
cannot be seen until until end-of-line appears, which in standard `console`
mode happens only when all tests finish) or Docker Compose logging output,
where in standard `console` mode each finished test's dot is printed
alone on separate line.

Or the console-lines mode can be handy just to see a more detailed
progress of tests in all environments, because it outputs something
like this:

```
· 1/85 Framework/Assert.contains.phpt OK in 0.14 s
· 2/85 CodeCoverage/PhpParser.parse.edge.phpt OK in 0.17 s
· 3/85 CodeCoverage/PhpParser.parse.lines-of-code.phpt SKIPPED in 0.18 s
· 4/85 CodeCoverage/PhpParser.parse.lines.phpt FAILED in 0.19 s
...
```

Also, "cider mode" now shows a lemon emoji for skipped tests.
@smuuf smuuf changed the title Added verbose output mode which prints each test on a separate line Added console-lines output mode which prints each test on a separate line Aug 15, 2023
@dg
Copy link
Member

dg commented Oct 4, 2023

What do you mean, @milo?

@dg dg force-pushed the master branch 3 times, most recently from 95674fc to c5eff68 Compare December 5, 2023 17:32
@dg dg merged commit 932a341 into nette:master Jan 7, 2024
4 of 11 checks passed
dg added a commit that referenced this pull request Jan 8, 2024
…ine. (#443)

This is handy for environments with non-standard (buffered) handling of
standard output, for example Github Actions (where a progress of tests
cannot be seen until until end-of-line appears, which in standard `console`
mode happens only when all tests finish) or Docker Compose logging output,
where in standard `console` mode each finished test's dot is printed
alone on separate line.

Or the console-lines mode can be handy just to see a more detailed
progress of tests in all environments, because it outputs something
like this:

```
· 1/85 Framework/Assert.contains.phpt OK in 0.14 s
· 2/85 CodeCoverage/PhpParser.parse.edge.phpt OK in 0.17 s
· 3/85 CodeCoverage/PhpParser.parse.lines-of-code.phpt SKIPPED in 0.18 s
· 4/85 CodeCoverage/PhpParser.parse.lines.phpt FAILED in 0.19 s
...
```

Also, "cider mode" now shows a lemon emoji for skipped tests.

Co-authored-by: David Grudl <david@grudl.com>
dg pushed a commit to nette/docs that referenced this pull request Jan 21, 2024
dg pushed a commit to nette/docs that referenced this pull request Jan 21, 2024
@smuuf smuuf deleted the smuuf_consolelinesoutput branch January 22, 2024 12:36
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.

None yet

3 participants