This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
forked from 2tvenom/go-test-teamcity
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 make test TESTFLAGS='-v -json' which isn't pure JSON but contains a bunch of `make` and `go 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` flag that 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: 1. the code isn't creating TeamCity Test Suite tags. I was never married 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. 2. Tests which aren't explicitly ended (due to premature exit/crash of 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 both to `go test` and `go-test-teamcity`.
- Loading branch information
Showing
6 changed files
with
2,331 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.