-
Notifications
You must be signed in to change notification settings - Fork 231
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
Update unit test dependencies #2068
Update unit test dependencies #2068
Conversation
I these tests are failing because they are a little sloppy, basically |
@benjaminapetersen Awesome. The errors are because {foo: undefined} is not equal to {} We're explicitly setting some fields to undefined in the services. |
@benjaminapetersen Have a look at spadgett@f27b948#diff-33e8a7d478aa060b7e40588f2ebd63ec and spadgett@f27b948#diff-ddf9d4dc92739022396ec6d3f59795e9 We might need to update Travis to use Node 6.x as well. |
@spadgett thanks! I didn't see your comment until my last push, but let me know your thoughts on this. I updated the tests (where they now fail) to break them down into very specific parts. If there is a failure, its focused on a single value or an object of much smaller complexity. Pros and cons:
I think the pros outweigh the cons since I always end up running the functions and Another potential con, I got around the sudden missing Def open to your thoughts & further adjustments. |
[test] |
6f81b61
to
b99d376
Compare
Ooop, forgot to drop [test] |
@benjaminapetersen I agree it makes it easier to diagnose failures, but I worry the tests are now passing with "bad" data. I'd rather fix the services not to set There are also things like https://www.npmjs.com/package/karma-jasmine-diff-reporter to better see what the diff is. That seems cleaner to me than rewriting our tests. |
Agreed, I'll try that diff reporter & update this. Curious if there is a good argument for both, the more explict test next to the blob comparison. |
Opened an issue with that reporter, the installation instructions are either incomplete or something is broken. reporter issue |
b99d376
to
dd372aa
Compare
Ok, since that diff reporter doesn't work, I kept both versions of the test. Hopefully will be short term, but I really dislike debugging these as blob vs blob. Will try to make progress on that issue as a follow-up. Meanwhile, this will get unit test dependencies 100% current, would like to get back to protractor for e2e & get that working on Mac. [test] |
expect(resources.buildConfig).toEqual( | ||
var generatedBuildConfig = resources.buildConfig; | ||
|
||
// specific tests to ease pain in debugging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the long run, these are going to make the tests harder to maintain. We've repeated everything twice, and it's a lot of work to write these. I'm not sure it's worth the tradeoff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benjaminapetersen I'd rather not test the same things twice. Since we have the diff reporter, let's remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff reporter states this is legacy behavior. Boo. I'm working on getting more info from the developer. It may mean that he isn't supporting it anymore. Mind if I hold off on deleting the code till I have a good answer? I hate to update all our dependencies just to end up with a deprecated dependency that will fall over on us again. Hopefully will get an answer soon.
flake? + ssh -F ./.config/origin-ci-tool/inventory/.ssh_config -t openshiftdevel 'bash -l -c "timeout 300 /tmp/tmp.jjTPwTJqTB"'
+ cd /data/src/github.com/openshift/aos-cd-jobs
+ trap 'exit 0' EXIT
+ sjb/gcs/started.py
++ exit 0
++ export status=FAILURE
++ status=FAILURE
+ set +o xtrace
########## FINISHED STAGE: FAILURE: RECORD THE STARTING METADATA [00h 05m 00s] ##########
Build step 'Execute shell' marked build as failure
[PostBuildScript] - Execution post build scripts.
[workspace] $ /bin/bash /tmp/jenkins8090829258080536932.sh [test] |
Fail cuz Firefox: Running "karma:unit" (karma) task
14 09 2017 21:54:48.085:ERROR [launcher]: Cannot start Firefox
14 09 2017 21:54:48.087:ERROR [launcher]: Firefox stdout:
14 09 2017 21:54:48.087:ERROR [launcher]: Firefox stderr:
14 09 2017 21:54:48.088:ERROR [launcher]: Firefox failed 2 times (cannot start). Giving up.
Warning: Task "karma:unit" failed.� Use --force to continue.
Aborted due to warnings.
Execution Time (2017-09-15 01:54:25 UTC)
loading tasks 364ms ▇ 2%
concurrent:test 5.4s ▇▇▇▇▇▇▇▇▇▇▇ 24%
postcss:dist 677ms ▇▇ 3%
karma:unit 16.3s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 71%
Total 22.8s
make: *** [test] Error 3
++ export status=FAILURE
++ status=FAILURE
+ set +o xtrace
########## FINISHED STAGE: FAILURE: RUN WEB CONSOLE TESTS [00h 06m 46s] ########## Good grief. Specified older FF in Travis similar to catalog 432. [test], plz. |
Travis does not appear to honor the browsers flag in our language: node_js
node_js:
- "6"
before_script:
- make build
script:
- grunt test --browsers=PhantomJS # hmmm.
- hack/verify-dist.sh
addons:
firefox "49.0"
|
Trying Nightmare because Firefox is being that anyway... [test] |
@benjaminapetersen I think you need a virtual screen. Let's try with current Firefox. before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start |
@spadgett I'll add that, though its odd that unit testing would require a window. Lets see. |
@spadgett We had caching of node modules between updates didn't we? Seems like testing is taking longer again. |
|
@benjaminapetersen We don't cache dependencies anymore, but it doesn't make that big of a difference. Most of the time is spent elsewhere. Test job usually takes about 20-30 minutes. |
Swapping back |
Looks like Jenkins has the same Firefox error as Travis |
Swapping to @stevekuznetsov I may request some assistance from you diagnosing my Firefox dilemma if this doesn't work. |
Adding a |
Looks like unit tests ran in Jenkins, but later starting protractor we get this:
|
package.json
Outdated
"protractor": "1.7.0", | ||
"protractor-screenshot-reporter": "0.0.5", | ||
|
||
"protractor": "^5.1.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to bump protractor in this pull? I thought other changes were needed for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, crap, my last swap between branches must have accidentally committed that, thanks. Will update and see where that gets us.
package.json
Outdated
@@ -69,6 +84,7 @@ | |||
"serve": "grunt serve", | |||
"start": "grunt serve", | |||
"test-integration": "grunt test-integration", | |||
"postinstall": "node test/upgrade-selenium.js && node_modules/protractor/bin/webdriver-manager update" | |||
"__postinstall": "node test/upgrade-selenium.js && node_modules/protractor/bin/webdriver-manager update", | |||
"_postinstall": "node_modules/protractor/bin/webdriver-manager update" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be causing the Jenkins failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, putting this back.
Ok put the protractor stuff back, lets see if this test runs. |
[test] |
Yay Jenkins survived this time. Now for Travis... |
Looks like the previous Travis run worked, but now it's stuck. |
.travis.yml
Outdated
# even our unit tests require a | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
- sleep 3 # give xvfb some time to start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to remove this if we're using PhantomJS (for now anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will comment out all of this display stuff & leave another FIXME
(& note it in the issue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will comment out all of this display stuff & leave another FIXME (& note it in the issue)
I'd rather just remove it to keep the code tidy :)
We could add this to the issue if necessary.
Gruntfile.js
Outdated
// if running locally on mac, we can test both FF & Chrome, | ||
// in Travis, just FF | ||
// ['Nightmare'] is a good alt for a current headless | ||
// TODO: fix this, PhantomJS is deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's track as an issue instead of a TODO in the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok ill update to FIXME & open an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove the comment altogether and just use the issue. I'd prefer to track things once, and TODOs tend to get forgotten
test/karma.conf.js
Outdated
], | ||
|
||
// Continuous Integration mode | ||
// if true, it capture browsers, run tests and exit | ||
singleRun: false, | ||
|
||
colors: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to try and add colors back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup can do.
|
||
// level of logging | ||
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG | ||
logLevel: config.LOG_DEBUG, | ||
logLevel: config.LOG_ERROR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason to change this from debug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was just noisy, was trying to cut down on stuff to swim through. Let me roll that back.
Ok, so we had one successful run? Pushing updates per the comments &... [test] again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but please squash. Thanks @benjaminapetersen, happy to see these updated
OOoooo it worked. neato. Will squash soon & be glad to be ready to roll with this. |
Looks like it may have been in the Travis queue for a while there. |
3eb08a0
to
9d1c673
Compare
9d1c673
to
91fe691
Compare
Squashed. [test] Btw, I had to swap back |
flake #1685 [test] |
Evaluated for origin web console test up to 91fe691 |
Origin Web Console Test Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_web_console/216/) (Base Commit: 5bf079c) (PR Branch Commit: 91fe691) |
[merge] |
Evaluated for origin web console merge up to 91fe691 |
Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin_web_console/205/) (Base Commit: 1466f66) (PR Branch Commit: 91fe691) |
https://trello.com/c/w3vdwj85
Updates
karma
related dependencies for unit testing.Looking into why a few tests now fail, will update again shortly (did we always have this pretty coverage tool?)(is a lot of red reported by that pretty coverage tool 😄 ).
to fix:
@spadgett