Conversation
deps/juggler-v3/test.js
Outdated
|
|
||
|
|
||
| /** from couldant.connection.test */ | ||
| describe('cloudant connection', function() { |
There was a problem hiding this comment.
I think this should stay in cloudant.connection.test.
The purpose of juggler-v*/test.js is to execute the shared test suite provided by juggler. Connector-specific tests are staying in test/* files and are executed against a single juggler version only. At least that have been our approach so far.
deps/juggler-v3/test.js
Outdated
| }); | ||
| }); | ||
| // keep this part? | ||
| describe('cloudant imported features', function() { |
There was a problem hiding this comment.
Let's remove this describe line, we already have describe(name,...) above - that should be enough.
It's also crucial to call require('loopback-datasource-juggler/test/*'); from inside describe(name,...) block!
describe(name, function() {
before(function() {
IMPORTED_TEST = true;
return global.resetDataSourceClass(juggler.DataSource);
});
after(function() {
IMPORTED_TEST = false;
return global.resetDataSourceClass();
});
require('loopback-datasource-juggler/test/include.test.js');
require('loopback-datasource-juggler/test/common.batch.js');
});
deps/juggler-v4/test.js
Outdated
|
|
||
| process.env.COUCHDB2_TEST_SKIP_INIT = true; | ||
|
|
||
| describe('cloudant automigrate.test - imported from couchdb2', function() { |
There was a problem hiding this comment.
The tests imported from loopback-connector-couchdb2 should stay in test/imported.test.js, they are not part of deps/juggler-v* test suite.
| }); | ||
|
|
||
| after(function() { | ||
| return global.resetDataSourceClass(); |
There was a problem hiding this comment.
To make this work, you need to modify test/init.js, add resetDataSourceClass helper and modify getDataSource to allow configuration of the data-source class used. See https://github.com/strongloop/loopback-connector-mongodb/pull/519/files#diff-40dfb1c53004f1488cbe6eb300b286dd
|
@slnode test please |
|
loopbackio/loopback-datasource-juggler#1750 should fix the 2 failures for the tests with juggler 4.x |
80c18fc to
8d1e93b
Compare
|
@slnode test please |
| }); | ||
| require('loopback-datasource-juggler/test/include.test.js'); | ||
| require('loopback-datasource-juggler/test/common.batch.js'); | ||
| }); |
There was a problem hiding this comment.
Please add a TODO comment to remind us that we should eventually include the following tests too:
loopback-datasource-juggler/test/default-scope.test.jsloopback-datasource-juggler/test/persistence-hooks.suite.js
See https://github.com/strongloop/loopback-connector-mongodb/blob/master/deps/juggler-v4/test.js
package.json
Outdated
| "eslint-config-loopback": "^4.0.0", | ||
| "loopback-datasource-juggler": "^3.0.0", | ||
| "eslint": "^5.1.0", | ||
| "eslint-config-loopback": "^10.0.0", |
There was a problem hiding this comment.
Update of eslint-config-loopback causes a lot of reformatting (adds a lot of insignificant white-space changes), which makes it difficult to see what changes are relevant to the introduction of the shared tests.
Please open a new pull request to update eslint config to the latest version & fix linting problems. Once that PR is landed, rebase this PR on top of the new master so that it contains only changes relevant to the introduction of the shared tests.
b364cf9 to
98b11e3
Compare
b23840b to
5fa0e51
Compare
5fa0e51 to
e0539a3
Compare
Description
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, which are triggered in
./test.js.Drop
Node.js 6CI tests as Juggler v4 does not support it. Also updateeslintto the latest version (see those 2 PRs below).Related issues
References issues
Checklist
guide