Access the jenkins.log or folder when using jenkinsrule

5 views
Skip to first unread message

Charles Moulliard

unread,
Dec 17, 2020, 3:46:11 AM12/17/20
to Jenkins Users
Hi,

Is it possible to access to the jenkins.log or the folder containing the files as I got this error when I run a junit test case ?

Legacy code started this job.  No cause information is available
Running as SYSTEM
Building in workspace /var/folders/t2/jwchtqkn5y76hrfrws7dqtqm0000gn/T/j h2639828161785432376/workspace/test0
Processing DSL script mavenProject/mavenJob.groovy
ERROR: java.io.IOException: Unable to read /var/folders/t2/jwchtqkn5y76hrfrws7dqtqm0000gn/T/j h2639828161785432376/jobs/mvn-spring-boot-rest-http/config.xml
Finished: FAILURE

Example of code:

    @Rule
    public JenkinsRule j = new JenkinsRule();

    @Test
    public void useMavenDSLGroovyFileAsJob() throws Exception {
        FreeStyleProject p = j.createFreeStyleProject();
        p.scheduleBuild2(0).get(); // run a build to create a workspace
        p.getSomeWorkspace().child("mavenProject/mavenJob.groovy").copyFrom(getClass().getResourceAsStream("/mavenJob.groovy"));

        ExecuteDslScripts e = new ExecuteDslScripts();
        e.setTargets("mavenProject/mavenJob.groovy");
        p.getBuildersList().add(e);

        // Assert if build succeeded, if the Script executed includes the echo message
        FreeStyleBuild b = j.assertBuildStatusSuccess(p.scheduleBuild2(0).get());

Cheers

Charles



Reply all
Reply to author
Forward
0 new messages