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

Returns 403 when run in CI Pipeline (using Storybook+Jest) #149

Open
PWookey opened this issue Oct 31, 2024 · 1 comment
Open

Returns 403 when run in CI Pipeline (using Storybook+Jest) #149

PWookey opened this issue Oct 31, 2024 · 1 comment

Comments

@PWookey
Copy link

PWookey commented Oct 31, 2024

Hi, I have a Typescript StencilJS and Storybook project. They use Jest under the hood for testing. I have added the report portal agent to the Jest config as a reporter. This is just a POC at the moment, so have a single very basic test.

When I run locally I can see my test pass and the result appears in Report Portal, however when the same is done in our Jenkins CI pipeline, we get this strange 403 error:

02:02:52  @XXXXXXXX: [TEST] Error: Request failed with status code 403
02:02:52  @XXXXXXXX: [TEST] URL: http://reportportal.XXXX.XXXXX.com:8080/api/v1/MFE/launch
02:02:52  @XXXXXXXX: [TEST] method: POST
02:02:52  @XXXXXXXX: [TEST]     at /home/jenkins/workspace/workspace/XXXXX/node_modules/@reportportal/client-javascript/lib/rest.js:43:15
02:02:52  @XXXXXXXX: [TEST]     at Object.dynatraceOnServiceExecutionIndicator [as doInvoke] (/opt/dynatrace/XXX/agent/bin/XXX/any/nodejs/nodejsagent.js:4033:22)
02:02:52  @XXXXXXXX: [TEST]     at /opt/dynatrace/XXX/agent/bin/XXX/any/nodejs/nodejsagent.js:9094:59
02:02:52  @XXXXXXXX: [TEST]     at u.runInContext (/opt/dynatrace/XXX/agent/bin/XXX/any/nodejs/nodejsagent.js:2351:24)
02:02:52  @XXXXXXXX: [TEST]     at /opt/dynatrace/XXX/agent/bin/XXX/any/nodejs/nodejsagent.js:9094:35

Have tested the Report Portal health check endpoint in the same pipeline using a curl command and that comes back positive, so doesn't seem a proxy issue. Additionally this is a 403 which implies there wasn't an issue with authentication.

"@reportportal/agent-js-jest": "5.1.0",
"@types/jest": "29.5.12",
"jest": "29.7.0",

Just wondering if this indicates an obvious solution that I'm just not getting

@robbiewareham
Copy link

I am working with Pete and can confirm that within the same jenkins executor that is executing the test, we can successfully handcraft the same request and are able to create a launch.

Therefore we can rule out any issues around firewalls, etc

The RP instance is HTTP rather than HTTPS...could that be of interest?

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

No branches or pull requests

2 participants