Skip to content

Conversation

mfridman
Copy link
Owner

This PR adds a -progress flag, which enables printing Package-level summary output as tests are still running.

For example, the PASS|FAIL|SKIP lines are printed as soon as the package tests are finished. This is useful for long-running test suites with a lot of output where -progress is too noisy.

$ go test ./... -json | tparse -progress
[PASS]      0.200s      github.com/pressly/goose/v4/internal/migrationstats
[FAIL]      0.362s      github.com/pressly/goose/v4/internal/sqlparser
[SKIP]      0.412s      github.com/pressly/goose/v4/pkg/source [no tests to run]
[PASS]     22.866s      github.com/pressly/goose/v4
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃   FAIL  package: github.com/pressly/goose/v4/internal/sqlparser   ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

--- FAIL: TestSemicolons (0.00s)

    parser_test.go:43: incorrect semicolon. got true, want false

┌───────────────────────────────────────────────────────────────────────────────────────────────────────┐
│  STATUS │ ELAPSED │                       PACKAGE                       │ COVER │ PASS │ FAIL │ SKIP  │
│─────────┼─────────┼─────────────────────────────────────────────────────┼───────┼──────┼──────┼───────│
│  PASS   │ 22.87s  │ github.com/pressly/goose/v4                         │  --   │  18  │  0   │  0    │
│  PASS   │  0.20s  │ github.com/pressly/goose/v4/internal/migrationstats │  --   │  10  │  0   │  0    │
│  FAIL   │  0.36s  │ github.com/pressly/goose/v4/internal/sqlparser      │  --   │  11  │  1   │  0    │
└───────────────────────────────────────────────────────────────────────────────────────────────────────┘

@mfridman
Copy link
Owner Author

mfridman commented Jun 7, 2023

Going to merge this as-is, but would be nice to get color support. I don't love the output, but will wait for feedback:

[PASS]       0.51s      github.com/pressly/goose/v4/internal/migrationstats
[PASS]       0.68s      github.com/pressly/goose/v4/internal/sqlparser
[FAIL]       2.82s      github.com/pressly/goose/v4
[FAIL]       0.46s      github.com/pressly/goose/v4/tests/e2e/clickhouse
[FAIL]       0.67s      github.com/pressly/goose/v4/tests/e2e/mysql
[FAIL]       0.56s      github.com/pressly/goose/v4/tests/e2e/postgres
[FAIL]       0.78s      github.com/pressly/goose/v4/tests/e2e/vertica
[FAIL]       1.01s      github.com/pressly/goose/v4/tests/gomigrations/error
[FAIL]       1.04s      github.com/pressly/goose/v4/tests/gomigrations/success

@ti-mo
Copy link

ti-mo commented Jun 8, 2023

Thanks! A touch of color in pass/fail/skip would be nice, yes. 👍

ti-mo added a commit to cilium/packer-ci-build that referenced this pull request Jun 12, 2023
This is to include mfridman/tparse#95.

Signed-off-by: Timo Beckers <[email protected]>
tklauser pushed a commit to cilium/packer-ci-build that referenced this pull request Jun 14, 2023
This is to include mfridman/tparse#95.

Signed-off-by: Timo Beckers <[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.

2 participants