Skip to content

Changes that add and integrate code coverage support into XDMoD's CI pipeline #1443

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

Draft
wants to merge 12 commits into
base: xdmod10.5
Choose a base branch
from

Conversation

ryanrath
Copy link
Contributor

@ryanrath ryanrath commented Sep 9, 2020

NOTE: this PR takes the place of #1350

All of the functional changes are the work of Zi-3 all that I've (@ryanrath) done is clean things up a little.

Description

  • Added four new scripts responsible for installing & configuring XDebug,
    generating the code coverage data from php file execution, and generating the final
    reports.
  • Updated shippable.yml so that XDebug is installed / Code Coverage is only generated during the nightly
    test build.
  • Updated numerous UI tests to work more reliably when XDebug is installed ( i.e. their timeouts were increased )
  • Updated a couple of UI test selectors to minimize the effects of latency on particular tests.
  • Added a new webdriverhelper function called clickSelectorAndWaitForMask as this was needed for a test or two.
  • Updated the timeouts for a few other webdriverhelper functions.

Motivation and Context

Adding code coverage will allow us to get a general sense of where we are lacking test code & possibly where we have unused code thus giving us a few more tools to help streamline / increase the reliability of XDMoD.

Tests performed

All the automated tests for an install / upgrade with & without XDebug installed.

Checklist:

  • The pull request description is suitable for a Changelog entry
  • The milestone is set correctly on the pull request
  • The appropriate labels have been added to the pull request

@ryanrath ryanrath added qa / testing Updates/additions to tests Category:General General labels Sep 9, 2020
@ryanrath ryanrath added this to the 9.5.0 milestone Sep 9, 2020
@ryanrath ryanrath requested review from jtpalmer and plessbd and removed request for jtpalmer September 9, 2020 19:33
browser.setValue(input, setting.updated);
const updatedValue = browser.getValue(input);
expect(updatedValue).to.equal(setting.updated);
for (let i = 0; i < 100; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will hide test failures if the exception is thrown more than 100 times

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to make multiple attempts then you'll need to (a) add a short pause between tries (e.g. 10ms), and (b) make sure to throw an exception if the max attempts is reached.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've ended up removing these for loops as the ended up being unnecessary with the latest updates.

browser.click(inputTrigger);
setTimeout(function () {
browser.click(inputTrigger);
}, 3000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

three seconds seems like a long time to wait here. Why was it increased so much?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the previous waitForVisible could also be combined into a waitAndClick

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've actually ended up removing the setTimeout calls and everything still seems to be passing both w/ and w/ out XDebug.

@ryanrath ryanrath force-pushed the zrcode_bkup branch 5 times, most recently from 180516d to 02428b3 Compare September 15, 2020 19:56
@ryanrath ryanrath requested review from jpwhite4 and removed request for jpwhite4 September 16, 2020 17:51
Copy link
Contributor

@plessbd plessbd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of me wants to do a completely separate PR just for all the test updates...But at the same time the reason they were done is because of the timing issues with xdebug enabled.
I am so conflicted...

plessbd
plessbd previously approved these changes Nov 2, 2020
Copy link
Contributor

@plessbd plessbd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good as long as it still passes shippable (cause travis is the broken at the moment)

@jpwhite4 jpwhite4 modified the milestones: 9.5.0, 10.0.0 Mar 8, 2021
@ryanrath ryanrath requested a review from eiffel777 May 5, 2021 18:21
@jtpalmer jtpalmer changed the base branch from xdmod9.5 to xdmod10.0 June 14, 2021 18:54
@ryanrath ryanrath modified the milestones: 10.0.0, 10.5.0 Jan 7, 2022
@jtpalmer jtpalmer changed the base branch from xdmod10.0 to xdmod10.5 March 24, 2022 14:50
Zi-3 and others added 7 commits September 1, 2022 15:28
- Added four new scripts responsible for installing & configuring XDebug,
  generating the code coverage data from php file execution, and generating the final
  reports.
- Updated `shippable.yml` so that XDebug / Code Coverage is only generated during the nightly
  test build.
- Updated numerous UI tests to work more reliably when XDebug is installed ( i.e. their timeouts were increased )
- Updated a couple of UI test selectors to minimize the effects of latency on particular tests.
- Added a new webdriverhelper function called `clickSelectorAndWaitForMask` as this was a commonly
  feature during developing this PR.
- Updated the timeout for a few other webdriverhelper functions.
- It was found while running these tests on the CentOS8 image, that the
`setupBeforeClass` function was not being called as expected, this small
addition will catch if the required `self::$hashFilePath` variable has been set,
and if not then run the `setupBeforeClass` function so that it is populated.
- Since we're now running this script on CentOS7|8 and Rocky8.5 containers we
need to take into account the different software versions / configuration
options that must be set to successfully collect the code coverage data
generated by our tests.
By installing Xdebug and setting up code coverage before running bootstrap we'll
generate code coverage information for our install / upgrade code including the
ETL code.
@ryanrath
Copy link
Contributor Author

ryanrath commented Sep 2, 2022

@jpwhite4 jpwhite4 marked this pull request as draft February 3, 2023 14:49
@jpwhite4 jpwhite4 modified the milestones: 10.5.0, 11.0.0 May 24, 2023
@bluebrey bluebrey mentioned this pull request Aug 14, 2023
3 tasks
@jpwhite4 jpwhite4 modified the milestones: 11.0.0, 11.5.0 Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:General General qa / testing Updates/additions to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants