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

Run shared tests from both v3 and v4 of juggler #376

Merged
merged 3 commits into from
May 6, 2019

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Apr 30, 2019

At the moment, our connectors are installing juggler 3.x to run the test suite. When we make a change to juggler@3, cis-jenkins detects downstream dependency and triggers CI build of connectors with the modified juggler version. When we make a change to juggler's master, no downstream builds are triggered.

In the past, we were maintaining multiple branches to test connectors against different juggler versions. E.g. loopback-2.x containing code from "master" but installing juggler 2.x for testing. This is rather impractical, because we don't have bandwidth to update those other branches with changes made to master.

In this pull request, I am reworking connector test setup to execute tests from both juggler versions 3.x and 4.x.

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

@bajtos bajtos requested review from elv1s, raymondfeng, zbarbuto and a team April 30, 2019 09:31
@bajtos bajtos self-assigned this Apr 30, 2019
@bajtos
Copy link
Member Author

bajtos commented Apr 30, 2019

Please note the test failures are coming from juggler v4, we haven't been running those tests yet. I'll fix them before landing this PR if we decide to continue in this direction.

test/mocha.opts Show resolved Hide resolved
test/init.js Show resolved Hide resolved
deps/juggler-v4/test.js Show resolved Hide resolved
test/init.js Show resolved Hide resolved
@bajtos
Copy link
Member Author

bajtos commented May 3, 2019

Please note the test failures are coming from juggler v4, we haven't been running those tests yet. I'll fix them before landing this PR if we decide to continue in this direction.

Should be fixed now, via loopbackio/loopback-datasource-juggler#1733 and [email protected]

@bajtos
Copy link
Member Author

bajtos commented May 3, 2019

loopback-connector-postgresql/node=6.x,os=windows — Failed! (795e064)

This test sometimes passes and other times it fails and the error message is not clear about what went wrong :(

115 passing (6s)
  1 failing

D:\t\t4938861194367131829dirbfr\node_modules\build-framework\node_modules\mocha-jenkins-reporter\lib\jenkins.js:259
    var n = ++currentSuite.failures;
                          ^

TypeError: Cannot read property 'failures' of null
    at Runner.<anonymous> (D:\t\t4938861194367131829dirbfr\node_modules\build-framework\node_modules\mocha-jenkins-reporter\lib\jenkins.js:259:27)
    at emitTwo (events.js:111:20)
    at Runner.emit (events.js:191:7)
    at Runner.fail (D:\workspace\loopback-connector-postgresql\d60c4a15\node_modules\mocha\lib\runner.js:251:8)
    at Runner.uncaught (D:\workspace\loopback-connector-postgresql\d60c4a15\node_modules\mocha\lib\runner.js:757:8)
    at process.uncaught (D:\workspace\loopback-connector-postgresql\d60c4a15\node_modules\mocha\lib\runner.js:839:10)
    at emitOne (events.js:96:13)
    at process.emit (events.js:188:7)
    at process._fatalException (bootstrap_node.js:300:26)

The CI re-runs the tests with DEBUG logs enabled and then the test suite passes. I am proposing to ignore this problem for now. Node.js 6 has reached EOL few days ago, I think it's time to remove it from our CI platforms.

[cis-jenkins] x64 && linux && nvm && dbs,8 — Failed! (795e064)

I suspect this is intermittent too, I've seen this error few times on my machine too, but not always.

09:20:45   1) autoupdate
09:20:45        foreign key constraint
09:20:45          should create, update, and delete foreign keys:
09:20:45 
09:20:45       Uncaught AssertionError [ERR_ASSERTION]: error: duplicate key value violates unique constraint "pg_namespace_nspname_index"
09:20:45       + expected - actual
09:20:45 
09:20:45       -false
09:20:45       +true
09:20:45       
09:20:45       at /home/jenkins/workspace/nb/loopback-connector-postgresql~master/3ed5ebba/test/postgresql.autoupdate.test.js:632:9

@bajtos
Copy link
Member Author

bajtos commented May 3, 2019

@slnode test please

@bajtos
Copy link
Member Author

bajtos commented May 3, 2019

All checks have passed this time. This pull request is ready for final review & landing. (I'll clean up the git history before merging.)

Copy link
Contributor

@b-admike b-admike left a comment

Choose a reason for hiding this comment

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

LGTM, hopefully we can see the changes in action soon.

test/postgresql.autoupdate.test.js Show resolved Hide resolved
deps/juggler-v4/test.js Show resolved Hide resolved
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.

2 participants