Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37615

ATH inconsistency when querying for Jenkins instance on a page object

    XMLWordPrintable

Details

    Description

      Let's describe the issue with a test. Assumming we already have an injector and a JenkinsController, the following test will fail:

      Jenkins j1 = new Jenkins(injector, jenkinsController);
      Assert.assertSame(j1, j1.jobs.getJenkins());
      

      The problem is that the jenkins instance returned by the getJenkins() method in the JobsMixIn object (actually inherited from PageObject) is not the instance that was passed as a context in the construction of this last one, but an instance that is looked up (and built if needed) using guice.

      This leads to potential inconsistencies for some operations (e.g. jobs.create) that rely on querying its jenkins instance, for example for the version number.

      Sometimes as an external user of the ATH I may need to create several instances with different versions, and want each jobs mixin to know exactly to which jenkins they belong to and behave consistently.

      Attachments

        Issue Links

          Activity

            People

              mfranco Manuel Franco
              mfranco Manuel Franco
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: