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

JenkinsLocationConfiguration.xml file is not created when using startJenkins() #467

Closed
joseblas opened this issue Jul 28, 2022 · 1 comment
Labels

Comments

@joseblas
Copy link
Contributor

joseblas commented Jul 28, 2022

Jenkins and plugins versions report

Environment Only JTH

What Operating System are you using (both controller, and any agents involved in the problem)?

Mac OS

Reproduction steps

This test shows the error:

      rr.startJenkins();
      String[] jenkinsLocations = rr.getHome().list(
              (dir, name) -> name.equalsIgnoreCase("jenkins.model.JenkinsLocationConfiguration.xml"));
      assertThat(jenkinsLocations, IsArrayWithSize.arrayWithSize(1));

When using rr.runRemotely the files is created (this includes rr.then), but not always then can be used (or makes testing very complex at least).

This test currently passes

  rr.then( s -> {
        String[] jenkinsLocations = s.jenkins.getRootDir().list(
                (dir, name) -> name.equalsIgnoreCase("jenkins.model.JenkinsLocationConfiguration.xml"));
        assertThat(jenkinsLocations, IsArrayWithSize.arrayWithSize(1));
        });

And this both scenarios should have the same outcome.

In my particular case, I have two Jenkins instances connecting to each other, one provides a file where the connections details are provided, which cannot be created (using RealJenkinsRule) because the locations hasn't been set yet.

This error happens now because previously the port was assigned beforehand and now is assigned by jetty in runtime by a file. To that port number could be passed out as param in jcasc

unclassified:
 location:
   url: ${MY_URL}

but now is impossible.

Expected Results

JenkinsLocationConfiguration.xml file exists when the RealJenkinsRule is used.

Actual Results

The mentioned file doesn't exist.

Anything else?

No response

@jglick
Copy link
Member

jglick commented Nov 30, 2023

#464 (comment)

@jglick jglick closed this as completed Nov 30, 2023
@jglick jglick reopened this Nov 30, 2023
@jglick jglick closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants