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

Add Go test plugin #88

Merged
merged 8 commits into from
Jan 13, 2021
Merged

Add Go test plugin #88

merged 8 commits into from
Jan 13, 2021

Conversation

ninjinkun
Copy link
Contributor

@ninjinkun ninjinkun commented Jan 12, 2021

Requirement

Install go-junit-report

go get -u github.com/jstemmer/go-junit-report

Usage

subset

subset command receives test names from stdin

go test -list . | launchable subset --name '#123' go_test > subset.txt
go test -run $(cat subset.txt)

record tests

record tests command read JUnit XML files.

go test -v 2>&1 | go-junit-report >  report.xml # convert output via go-junit-report 
launchable record tests --name '#123' go_test .

Disucussion

Should the plugin command name be go_test or go-test?

@ninjinkun ninjinkun marked this pull request as ready for review January 12, 2021 13:45
Copy link
Member

@kohsuke kohsuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting!!

@ninjinkun
Copy link
Contributor Author

ninjinkun commented Jan 13, 2021

@kohsuke @awilkes I found one more discussion point. This subset command outputs with white spaces such as ExampleTest1 ExampleTest2 ExampleTest3. However go test -run receive regexp only. It means customers need to convert the output to ^ExampleTest1$ |^ExampleTest2$|^ExampleTest3$ via shell script (see Usage on the PR I updated). Do you think we need to integrate the conversion into the CLI?

@ninjinkun
Copy link
Contributor Author

I changed subset output to regexp ^ExampleTest1$ |^ExampleTest2$|^ExampleTest3$.

@kohsuke
Copy link
Member

kohsuke commented Jan 13, 2021

The less the users have to do the better, so I think this makes sense 👍

@ninjinkun ninjinkun merged commit 4573661 into main Jan 13, 2021
@ninjinkun ninjinkun deleted the go-test branch January 13, 2021 14:53
gitbook-com bot pushed a commit that referenced this pull request Dec 13, 2022
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.

3 participants