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

ATH inconsistency when querying for Jenkins instance on a page object

    XMLWordPrintable

    Details

    • Similar Issues:

      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

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Manuel Franco
            Path:
            src/main/java/org/jenkinsci/test/acceptance/po/ContainerPageObject.java
            src/main/java/org/jenkinsci/test/acceptance/po/Jenkins.java
            src/main/java/org/jenkinsci/test/acceptance/po/PageObject.java
            http://jenkins-ci.org/commit/acceptance-test-harness/158b7c7c872b2702cb01fd876326318bc12dc4b9
            Log:
            JENKINS-37615 Honor context PageObject when looking for Jenkins instance

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Franco Path: src/main/java/org/jenkinsci/test/acceptance/po/ContainerPageObject.java src/main/java/org/jenkinsci/test/acceptance/po/Jenkins.java src/main/java/org/jenkinsci/test/acceptance/po/PageObject.java http://jenkins-ci.org/commit/acceptance-test-harness/158b7c7c872b2702cb01fd876326318bc12dc4b9 Log: JENKINS-37615 Honor context PageObject when looking for Jenkins instance
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oliver Gondža
            Path:
            src/main/java/org/jenkinsci/test/acceptance/po/ContainerPageObject.java
            src/main/java/org/jenkinsci/test/acceptance/po/Jenkins.java
            src/main/java/org/jenkinsci/test/acceptance/po/PageObject.java
            http://jenkins-ci.org/commit/acceptance-test-harness/ea8af8cec23af237cb3fa28bf0d0b4d7c38984c3
            Log:
            Merge pull request #177 from mafraba/JENKINS-37615

            JENKINS-37615 Honor context PageObject when looking for Jenkins instance

            Compare: https://github.com/jenkinsci/acceptance-test-harness/compare/e77667451a3f...ea8af8cec23a

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/org/jenkinsci/test/acceptance/po/ContainerPageObject.java src/main/java/org/jenkinsci/test/acceptance/po/Jenkins.java src/main/java/org/jenkinsci/test/acceptance/po/PageObject.java http://jenkins-ci.org/commit/acceptance-test-harness/ea8af8cec23af237cb3fa28bf0d0b4d7c38984c3 Log: Merge pull request #177 from mafraba/ JENKINS-37615 JENKINS-37615 Honor context PageObject when looking for Jenkins instance Compare: https://github.com/jenkinsci/acceptance-test-harness/compare/e77667451a3f...ea8af8cec23a

              People

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

                Dates

                Created:
                Updated:
                Resolved: