Giter VIP home page Giter VIP logo

Comments (4)

HardNorth avatar HardNorth commented on June 12, 2024 1

Please use this example: https://github.com/reportportal/examples-java/blob/master/example-testng-logback/src/main/java/com/epam/reportportal/example/testng/logback/logging/LaunchUrlLoggingTest.java

from agent-java-testng.

ASaiAnudeep avatar ASaiAnudeep commented on June 12, 2024

Alternatively we can read the reportportal.sync file to get the launch id.

from agent-java-testng.

HardNorth avatar HardNorth commented on June 12, 2024

@ASaiAnudeep this file might be hard-locked, so you might get IOException.

from agent-java-testng.

ASaiAnudeep avatar ASaiAnudeep commented on June 12, 2024

Reading .sync is not raising any io exception in both mac and windows environments.

public static void saveReportPortalLaunchId() {
  Path rp_path = Paths.get("reportportal.sync");
  Path env_path = Paths.get(".env");
    try {
      if (Files.exists(rp_path)) {
        String content = Files.readString(rp_path, StandardCharsets.US_ASCII);
	String launch_id = content.split(":")[1];
	if (!Files.exists(env_path)) {
	  Files.createFile(env_path);
	}
	Files.writeString(env_path, "RP_LAUNCH_ID=" + launch_id);
       }
    } catch (IOException e) {
      e.printStackTrace();
    }
}

from agent-java-testng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.