363 Commits

Author SHA1 Message Date
85bf4716ac Bump dev version 2023-10-19 00:36:43 +01:00
14d61e6e75 Release v2.1.0 v2.1.0 2023-10-19 00:36:08 +01:00
a24b123bbb Merge pull request #170 from sdowell/gotest-parsing
fix: properly parse resume prefix for gotest 1.20
2023-10-18 23:54:16 +01:00
506f0123d0 Update workflow to use the latest stable Go versions 2023-10-18 23:53:14 +01:00
8a66d8a276 fix: properly parse resume prefix for gotest 1.20
gotest 1.20 replaced the CONT prefix with NAME. This updates the gotest
parsing logic to support the new output format.

See: https://go-review.git.corp.google.com/c/go/+/443596
2023-09-21 14:16:36 -07:00
7933520f1e Merge pull request #157 from nipeharefa/add-darwin-arm
add darwin arm64
2023-03-21 23:12:45 +00:00
aab80035bb Merge pull request #161 from cameron-dunn-sublime/accurate-test-run-at
Accurate test timestamps by moving ProcessEvent
2023-03-21 23:03:25 +00:00
145d8019af Accurate test timestamps by moving ProcessEvent
https://github.com/jstemmer/go-junit-report/issues/147

By moving the ProcessEvent call up to parse we call it as soon
as each event is read. This ensures that the timestampFunc is
called approximately when the test is run. This ensures that
the time of the whole test suite can be measured.
2023-03-15 10:38:27 -07:00
e99b497c13 add darwin arm 2023-01-30 00:37:24 +07:00
bfac3ec01f Merge pull request #155 from greg-dennis/patch-1
Fix typo in comment
2022-12-11 17:24:25 +00:00
3ab645c5e0 Fix typo in comment 2022-12-08 09:12:37 -05:00
e939e4f120 gtr: Fix typo in comments 2022-09-30 23:17:05 +01:00
ce2d6b2372 Add go report card badge to README 2022-09-30 23:16:59 +01:00
075629ad5f junit: Add Testsuites.WriteXML method 2022-09-30 23:04:10 +01:00
b1271c39f9 Restrict Github workflow job permissions 2022-09-30 22:48:06 +01:00
79c139d4b9 Add pkg.go.dev badge to README 2022-09-29 21:51:37 +01:00
292aab72b9 parser/gotest: Only run fuzz tests on Go versions that support it 2022-09-27 22:01:35 +01:00
9b4f5520f7 Add test for reports without properties 2022-09-27 21:51:00 +01:00
3445b88cb1 parser/gotest: Add fuzzing test for parseLine 2022-09-24 20:52:08 +01:00
f50ae24655 Merge pull request #144 from kevinxw/master
Fix regular expression for summary with "no statements" coverage.
2022-09-22 23:24:50 +01:00
03f6f9e2dc Merge branch 'jstemmer:master' into master 2022-09-22 12:48:14 -07:00
9c64855bf7 Fix regular expression for summary with "no statements" coverage.
Move the status message to the end of the regular expression.
2022-09-22 19:46:38 +00:00
934b104ddd junit: Remove properties helper function in junit_test.go 2022-09-17 22:37:47 +01:00
2b3d79c572 junit: Specify unicode replacement character as \uFFFD
This is just to make the exact character we want to return explicit,
otherwise it could be confused by any unsupported character in your text
editor.
2022-09-17 22:33:04 +01:00
84a5190347 Escape illegal XML characters in junit output (#140) 2022-09-17 22:26:44 +01:00
97e0285183 parser/gotest: Handle build errors in test packages with _test suffix
It's possible for test files to declare a package with the "_test"
suffix. If these packages contain build errors, they were not correctly
matched to the package without the "_test" suffix.

Refs #145
2022-09-17 01:09:34 +01:00
81e5aaaaf1 parser/gotest: Make sure every build error is processed
Make sure we don't ignore any build error that did not belong to a
package. This isn't expected to normally happen, but we need to handle
it anyway to prevent accidentally ignoring potential errors.

Refs #145
2022-09-17 01:09:15 +01:00
cb3436fc5f parser/gotest: Do not ignore failures in a test summary
The ReportBuilder ignores summary results if we never collected any
events for that package. While under normal circumstances we wouldn't
expect this to happen (unless some output was lost or due to a bug in
go-junit-report), we should at the very least make sure that failed
results are not ignored.

Refs #145
2022-09-17 00:06:11 +01:00
77475bf23b parser/gotest: Fix test error messages in report_builder_test.go 2022-09-17 00:03:11 +01:00
7b10b42854 Merge pull request #141 from jstemmer/refactor-report-builder
Refactor report builder to support interleaved events from different packages
2022-08-23 23:04:51 +01:00
c796dcf8d1 junit: Remove unused indent parameter from formatOutput function 2022-08-23 23:04:15 +01:00
917d9f7023 Merge pull request #143 from greg-dennis/master
Report stores a slice of Property structs instead of a map
2022-08-23 23:03:23 +01:00
bf9aa098bb Fix SetProperty and add unit test. 2022-08-23 13:53:51 -04:00
15d215e49d Report stores a slice of Property structs rather than a map, to mimic JUnit properties, which have a deterministic ordering and allow multipler properties with the same name. 2022-08-23 10:41:42 -04:00
35c4d8a827 Merge pull request #142 from greg-dennis/patch-1
go-junit-report_test should fail if no files found
2022-08-19 21:31:31 +01:00
39473dc54e go-junit-report_test should fail if no files found
Today, if the testdata directory isn't present, this test trivially passes. This makes it fail when no files are found.
2022-08-19 10:55:25 -04:00
4d0ed8b681 Add testdata for go test -json -race tests.
Refs #134
2022-08-15 22:35:27 +01:00
9357c180d4 parser/gotest: Add support for processing events for different packages
The reportBuilder assumed we were always processing events for a single
package at a time. This is not true however when running `go test -json
-race` for example. In order to properly support processing events from
different packages we now have packageBuilders per package name.

Fixes #134
2022-08-15 22:35:27 +01:00
85f2715ac9 parser/gotest: Create JSONEventReader in internal reader package
The JSONEventReader implements reading lines with metadata and replaces
the gotest.jsonReader struct.
2022-08-15 22:07:52 +01:00
bd21d54501 parser/gotest: Add Package to Event
This allows each event to belong to a package, if we know it in advance.
2022-08-15 22:07:52 +01:00
f6f9df42b9 parser/gotest: Create interface for reading lines with metadata 2022-08-15 22:07:52 +01:00
27ad87e370 parser/gotest: parseLine now returns the events it creates 2022-08-15 22:07:52 +01:00
2af321a697 parser/gotest: Refactor benchmark grouping
The only reason groupBenchmarksByName needed the reportBuilder receiver
was to access its output collector. By passing the output explicitly to
the groupBenchmarksByName function we can remove the reportBuilder
dependency.
2022-08-15 22:05:38 +01:00
b73e4a9ed5 parser/gotest: Remove unnecessary if statement when creating a package
We only execute this branch when we've captured some global output, so
no need to check that again.
2022-08-13 22:06:49 +01:00
4ce910564c parser/gotest: timestampFunc should always be set, skip nil check 2022-08-13 21:59:50 +01:00
1c826cb28d parser/gotest: Switch to output collector for active id tracking 2022-08-13 20:50:39 +01:00
83ca558534 parser/gotest: Return created id from CreateTest method 2022-08-13 20:50:39 +01:00
50c1179050 parser/gotest: Remove benchmark specific methods from reportBuilder 2022-08-13 20:50:39 +01:00
9d434fa4b4 parser/gotest: Implement active id tracking in output collector 2022-08-13 20:50:39 +01:00
d6bf22343d parser/gotest: Move event processing into reportBuilder 2022-08-13 20:48:36 +01:00