0

I am running golang test cases and saving test result to testreport.xml by following command. go test -v ./testqa | go-junit-report > testqa/testreport.xml

Where testqa is my test folder which contains framework code, testreport.xml file and test files in it.

xml file read by jenkins and by using go-junit-report module, I am displaying those result to jenkins UI.

So there are two scenarios

  1. Jenkins running in my local workspace upper command works fine in my local Jenkins which runs on local workspace. It is perfectly populating that xml file and displaying result correctly.

  2. I also need to configure go-junit-report to project remote server. Project workspace, I am using here is Github url.

If I run this command >> go test -v ./testqa , test runs fine in company's jenkin server

But when I use this command for test reporting >>> go test -v ./testqa | go-junit-report > testqa/testreport.xml

There error I got is

/tmp/jenkins9406057064778860048.sh: 5: go-junit-report: not found

4
  • go-junit-report is not installed on the jenkins node. Commented Feb 24, 2022 at 12:37
  • Thanks for response , could you please guide me how to do that. Any doc or reference will work for me. Commented Feb 24, 2022 at 12:41
  • github.com/jstemmer/go-junit-report#installation Commented Feb 24, 2022 at 13:27
  • This helped me. ${GOROOT}/bin/go install github.com/jstemmer/go-junit-report@latest ------------------------------------------ ${GOROOT}/bin/go test -v ./testqa | ${GOROOT}/bin/bin/go-junit-report > testqa/testreport.xml Commented Mar 8, 2022 at 9:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.