reportportal / client-javascript

This Client is to communicate with the ReportPortal on Node.js.
https://www.npmjs.com/package/@reportportal/client-javascript
Apache License 2.0
16 stars 51 forks source link

Update launch throws an error after launch finishes. #168

Open quldude opened 1 year ago

quldude commented 1 year ago

I have the following code to update a finished launch:

// version = "@reportportal/client-javascript": "^5.0.13"

import RPClient from "@reportportal/client-javascript";

const rpClient = new RPClient(RPconfig);
  const launchObj = await rpClient.startLaunch({});
  const launchData = await launchObj.promise;
  rpLaunchId = launchData.id;
  console.log(`ReportPortal launch id: ${rpLaunchId}`);

  const launchFinishObj = rpClient.finishLaunch(launchObj.tempId);
  const launchFinishData = await launchFinishObj.promise;
  const update = await rpClient.updateLaunch(launchObj.tempId, {
    attributes: [
      {
        key: "Build",
        value: process.env.BUILD_NUMBER,
      },
    ],
  });
  await update.promise;

but the updateLaunch throws an error:

Request failed with status code 400: {"timestamp":1693411134135,"status":400,"error":"Bad Request","path":"/v1/{project}/launch/{launchId}/update"}

What am I doing wrong in the request body of updateLaunch?

AmsterGet commented 11 months ago

Hi @quldude ! Everything looks fine, cannot reproduce your issue. Please try with the latest Report Portal version.

AmsterGet commented 9 months ago

Hi @quldude ! Is this issue still actual for you?

AmsterGet commented 7 months ago

Hi @quldude ! Did using a fresh version of RP solve the problem?