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

Improve unit and integration tests and avoid relying on E2E (ATH) for front end code

    • Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2, Blue Ocean 1.1-beta4, Blue Ocean 1.1, Blue Ocean 1.1

      Currently we have some unit tests for UI, a lot of unit and integration tests for API, but rely mostly on ATH for feature and integration testing. 

      This is perhaps not optimal, there must be ways where we can unit and even integration tests components without end to end testing with full browsers. Eg, could we aim for a pyramid of tests like: 

      https://2.bp.blogspot.com/-YTzv_O4TnkA/VTgexlumP1I/AAAAAAAAAJ8/57-rnwyvP6g/s1600/image02.png from: https://testing.googleblog.com/2015/04/just-say-no-to-more-end-to-end-tests.html 

      In scope: 

      • Look at a way of reporting test coverage (so we can report on it) and know where we stand
      • Consolidate test runners used (karma or mocha?) across modules
      • Improve code coverage (even if small improvement) for unit testable areas in javascript code where it makes sense, using mocks, component testing, whatever
        • Add unit tests for Activity, Branches and Pagers tab to ensure that data doesn't "blink" when pressing "Show More" (see JENKINS-43702). Note: this is currently a bug on Pull Requests tab.

          [JENKINS-43083] Improve unit and integration tests and avoid relying on E2E (ATH) for front end code

          Michael Neale created issue -
          Michael Neale made changes -
          Epic Link New: JENKINS-36178 [ 172150 ]

          Michael Neale added a comment -

          cc imeredith this might be worth researching too

          Michael Neale added a comment - cc imeredith this might be worth researching too
          Michael Neale made changes -
          Rank New: Ranked higher
          Michael Neale made changes -
          Priority Original: Major [ 3 ] New: Critical [ 2 ]

          Michael Neale added a comment -

          cliffmeyers IVan did some reasearch on this and was going to write it up. The start of the art for unit and integration testing of react apps is not terribly impressive it seems, would be good to get your feelings on it too. I am sure we can do better. 

          Michael Neale added a comment - cliffmeyers IVan did some reasearch on this and was going to write it up. The start of the art for unit and integration testing of react apps is not terribly impressive it seems, would be good to get your feelings on it too. I am sure we can do better. 

          Cliff Meyers added a comment -

          Couple of useful reads I found over the weekend that seem to be pro-Jest:
          https://www.codementor.io/vijayst/unit-testing-react-components-jest-or-enzyme-du1087lh8
          https://blog.grommet.io/post/2016/09/01/how-we-landed-on-jest-snapshot-testing-for-javascript

          And at least one contrarian opinion:
          https://www.reddit.com/r/reactjs/comments/46cwj3/whats_february_2016s_best_alternative_to_jest_i/

          I am not sold on it, although I do think it might be worth taking a look at. Happy to discuss more.

          Cliff Meyers added a comment - Couple of useful reads I found over the weekend that seem to be pro-Jest: https://www.codementor.io/vijayst/unit-testing-react-components-jest-or-enzyme-du1087lh8 https://blog.grommet.io/post/2016/09/01/how-we-landed-on-jest-snapshot-testing-for-javascript And at least one contrarian opinion: https://www.reddit.com/r/reactjs/comments/46cwj3/whats_february_2016s_best_alternative_to_jest_i/ I am not sold on it, although I do think it might be worth taking a look at. Happy to discuss more.
          James Dumay made changes -
          Rank New: Ranked higher
          James Dumay made changes -
          Rank New: Ranked lower
          James Dumay made changes -
          Rank New: Ranked lower

            cliffmeyers Cliff Meyers
            michaelneale Michael Neale
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: