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

GPII-2515: Add code coverage reporting... #94

Merged
merged 12 commits into from
May 23, 2018

Conversation

the-t-in-rtf
Copy link
Member

See GPII-2515 for details.

@gpii-bot
Copy link

gpii-bot commented Aug 1, 2017

CI job failed. Please visit http://lists.gpii.net/pipermail/ci/ for more details.

@the-t-in-rtf
Copy link
Member Author

As with the similar universal PR, the tests will not pass here until the CI job is updated. As with that PR, I propose that we review, then update the CI job and confirm passing as a final step before merging.

@the-t-in-rtf
Copy link
Member Author

@gpii-bot
Copy link

gpii-bot commented Aug 1, 2017

CI job failed. Please visit http://lists.gpii.net/pipermail/ci/ for more details.

@gtirloni
Copy link
Contributor

gtirloni commented Aug 1, 2017

ok to test

@gpii-bot
Copy link

gpii-bot commented Aug 1, 2017

CI job failed. Please visit http://lists.gpii.net/pipermail/ci/ for more details.

@gtirloni
Copy link
Contributor

gtirloni commented Aug 1, 2017

@the-t-in-rtf looks like there's a small typo in package.json (missing run in npm test:acceptance).

Could you also update the Fedora box to version 26 in the Vagrant file (or merge 'master')?

@gpii-bot
Copy link

gpii-bot commented Aug 2, 2017

CI job passed.

@the-t-in-rtf
Copy link
Member Author

Thanks, @gtirloni, good catch on the typo. I merged with master as well and confirmed working with the Fedora 26 box.

@gtirloni
Copy link
Contributor

This was mentioned in the architecture meeting on 8/9 and it's blocking other PRs (e.g. #95).

I can revert the CI configuration if the review for this PR will take more time.

@the-t-in-rtf
Copy link
Member Author

@gtirloni, although it's nice to know this PR will eventually pass once the CI config is updated, it makes more sense to update the CI config after it's been reviewed, but before it's merged. That's what I was trying to propose earlier. I'd suggest reverting the CI config, we can discuss the timeline (and hopefully find someone to actually review this) in the meeting.

gtirloni added a commit to GPII/ci-service that referenced this pull request Aug 28, 2017
@the-t-in-rtf
Copy link
Member Author

Hi, @javihernandez. Just seeing if you have any bandwidth to look at this, it's just adding code coverage reporting to the linux repo.

Copy link
Member

@javihernandez javihernandez left a comment

Choose a reason for hiding this comment

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

Hey @the-t-in-rtf, sorry for the long delay in reviewing this. I've been taking a look at it and, in general, it looks very good. Can you please update it according to the review in order to get rid of UnitTests.sh?
BTW, thanks for such improvement 👍

pushd .
cd ../gpii/node_modules/gsettingsBridge/tests
cd gpii/node_modules/gsettingsBridge/tests
# TODO: See if we can make this into a javascript-only approach
./runUnitTests.sh
Copy link
Member

Choose a reason for hiding this comment

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

I guess that we will get rid of this shell script (UnitTests.sh) but it won't run after your refactoring of runUnitTests.sh.

Copy link
Member Author

Choose a reason for hiding this comment

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

As soon as I confirm the node_gsettings tests will run, I'll get rid of it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

./runUnitTests.sh
# TODO: Produces no output when run on its own from the repo root. Investigate.
Copy link
Member

Choose a reason for hiding this comment

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

This won't produce any output unless there's an error as nodegsettings_tests.js uses the assert module. I'd say that these tests must be updated to use jqUnit so we can get the output even if they're not failing. In any case, you can just add it into UnitTests.js so it runs like the others and we can just get rid of this script. The side-effect of this is that we won't get the results of the rest of the tests when this one (nodegsettings_tests.js) fails until we refactor the tests to use jqUnit.

Copy link
Member Author

@the-t-in-rtf the-t-in-rtf Oct 12, 2017

Choose a reason for hiding this comment

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

I'll rewrite the tests to use node-jqUnit, that seems too easy to not just take care of while I'm here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@@ -0,0 +1,9 @@
// Rollup to run all javascript-only unit tests.
"use strict";
require("../gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js");
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch on the missing test. I searched to make sure I had the rest.

@gpii-bot
Copy link

CI job failed: https://ci.gpii.net/job/linux-tests/114/

@the-t-in-rtf
Copy link
Member Author

the-t-in-rtf commented Oct 12, 2017

Thanks for the feedback, @javihernandez. I have updated the PR as suggested. I went ahead and converted the gsettings tests to use jqUnit. Following these changes, here is an example of the current coverage output. This should be ready for further review.

@the-t-in-rtf
Copy link
Member Author

@javihernandez, just to confirm, the idea is, once you're happy, we ask @gtirloni to update the CI config, confirm the builds pass, and merge.

@gpii-bot
Copy link

CI job failed: https://ci.gpii.net/job/linux-tests/115/

@the-t-in-rtf
Copy link
Member Author

Hi, @javihernandez, as far as I can see, I addressed your feedback a while ago. Can you please take a look again?

@javihernandez
Copy link
Member

ok to test

@gpii-bot
Copy link

CI job failed: https://ci.gpii.net/job/linux-tests/125/

@the-t-in-rtf
Copy link
Member Author

@javihernandez, this pull replaces the previous Grunt infrastructure, so the CI jobs will not work until the configuration is updated. As with similar pulls against other repos, we need to verify this using vagrant up && npm run test:vagrant for now, and once we're satisfied, discuss switching the CI builds for this repo to use the new commands, then merge the pull once the updated builds run successfully.

That's assuming we're still talking about the existing Jenkins jobs. If this is scheduled to be updated to use buildkite, we could test a new configuration as part of the pull. @avtar?

@javihernandez
Copy link
Member

Hi @the-t-in-rtf, right, I remembered that right after checking on the logs why this was failing on CI. 🤦‍♂️

I've just created a fresh vagrant box and I see that it's using node8/npm5, so I guess that we need to revert this situation until we find the right moment to do the switch (eventually, we can keep node 8 but we need to use an older version of npm). @gtirloni @amatas?

@gtirloni
Copy link
Contributor

For Linux, the desired npm version can be selected in the provisioning/vars.yml file (see https://github.com/GPII/linux/blob/master/provisioning/vars.yml#L14-L15).

@avtar
Copy link
Contributor

avtar commented Dec 21, 2017

@the-t-in-rtf At the moment there aren't any plans for switching GPII projects to using Buildkite. That work was done for Infusion since PRs weren't being tested.

@javihernandez
Copy link
Member

Hi @the-t-in-rtf,

I went through this one again and I had difficulties to run the acceptance tests after merging it with current linux/master. There is an underlying problem with the version of universal that you are introducing in this pr. Luckily, I updated the universal reference to point to current universal/master and it solved the issue. Can you update this pr:

  • to be in sync with linux/master
  • to update the universal reference with the last one

Thanks again for your work on this 👍

@the-t-in-rtf
Copy link
Member Author

Hi, @javihernandez. I pulled in the recent changes to linux (only the Vagrant config, looks like) and updated to the latest commit of universal. The tests and code coverage report now run as expected, here's an example of the output:

https://the-t-in-rtf.github.io/coverage-reports/linux/20180215/

@gpii-bot
Copy link

CI job failed: https://ci.gpii.net/job/linux-tests/137/

@the-t-in-rtf
Copy link
Member Author

Just to confirm, this pull also migrates away from using grunt tasks, in favour of npm scripts. The CI builds will not work until we agree this is far enough along to update the config to simply run "npm test".

@gtirloni
Copy link
Contributor

gtirloni commented Apr 2, 2018

Tested this PR manually with the newest version of the Fedora 27 box (20180330).

Unit:

$ npm run test:vagrantUnit
...
14:45:40.835:  jq: ***************
14:45:40.836:  jq: All tests concluded: 114/114 total passed in 48813ms - PASS
14:45:40.836:  jq: ******

Acceptance:


$ npm run test:vagrantAcceptance

14:46:46.153: jq: ***************
14:46:46.153: jq: All tests concluded: 122/122 total passed in 20321ms - PASS
14:46:46.153: jq: ***************

@the-t-in-rtf
Copy link
Member Author

@javihernandez, as far as I can see all we need to do is agree to update the CI config and encourage everyone with an open pull to bring in these changes. I will bring it up at tomorrow's meeting.

@javihernandez javihernandez merged commit 21b322b into GPII:master May 23, 2018
@javihernandez
Copy link
Member

@the-t-in-rtf thanks for your work on this!
I guess that now we must:

  • Ask devops to update our CI
  • Ask developers to update their pull requests against this repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants