'go-junit-report is not found in jenkins' remote server but in local jenkins its working fine

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



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source