This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This executes on the plan outlined in:
https://github.com/cockroachdb/go-test-teamcity/issues/5#issuecomment-422494665
by making go-test-teamcity take test2json input. More precisely, and
unfortunately, it realistically has to be taking the input of
which isn't pure JSON but contains a bunch of
make
andgo build
output (requiring a bit of massaging to pluck the relevant JSON from
the input stream).
I retained the old functionality and introduced a new
-json
flagthat triggers the new code. This important because our CI scripts
are versioned, and so we need the updated code here to work with
the non-updated CI pipeline.
I initially tried to jsonify the old test cases, but they're basically
garbage and don't correspond to real test output in some cases. Instead,
I generated a new corpus from actual CI runs in the main repo from which
I copied the artifacts file:
cockroachdb/cockroach#30406
I think it's worth checking in that PR in suitable form because it'll
allow us to iterate on this parser and extend the corpus much more
easily in the future.
Two caveats:
to those and have found it unfortunate that they mess up TeamCity's test
duration counting (as far as I can remember). Adding them is probably
possible, but with parallel tests (which we don't use heavily) and such
I'm pretty sure that any naive implementation would be incorrect.
the package test binary) are now output at the very end of the log.
Since the input contains all tests, this can be a little unintuitive.
However, these final tests contain basically no information anyway, so
that seems fine. This could be improved by flushing out the tests
whenever a package-level PASS/FAIL event is encountered, but I'm not
sure it's worth doing so.
The next step, assuming the code is in good order, is to merge it and
update the CI pipeline in the main repo to pass the
-json
flags bothto
go test
andgo-test-teamcity
.