-
Notifications
You must be signed in to change notification settings - Fork 234
COMPASS 156 Range Component - queryToParams #546
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
Conversation
test/validation.store.test.js
Outdated
}); | ||
|
||
it('goes into {fetchState: "error"} when receiving an invalid validator doc', function(done) { | ||
it.skip('goes into {fetchState: "error"} when receiving an invalid validator doc', function(done) { |
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.
what about this and the other skipped tests? are they no longer valid?
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.
Basically these two it.skip
worked in the isolated repo so I don't know whether it's something changed as part of the migration into Compass, or something specific to Compass causing them to error: 636a0a5
If you are 100% sure we aren't going back to a shared repo, i.e. these will stay in internal-packages
then we should probably delete these 2 skipped tests if you can't see an easy way to fix them (I can't).
Of the other skipped tests in npm run ci
:
- The
context.skip
ones work once therange.js
rule is included inindex.js
, so they are skipped in 2f4a406 as a byproduct and will pass when this feature is turned on in COMPASS-235, i.e. a valid use of skip as they are only temporarily failing because of this temporary feature flag. - The simulate click
skip
never worked, we just didn't know because we got lucky when we tested it once and got the passing race condition instead of the failing race condition because we didn't include adone()
in our group programming session.
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.
Expected npm run ci
output if you revert 2f4a406 (pending COMPASS-235):
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.
@rueckstiess Actually scratch my earlier advice, it looks like all the goes into {fetchState: ZZZ
tests sometimes fail, sometimes pass https://travis-ci.com/10gen/compass/builds/34022022
test/validation.store.test.js
Outdated
}); | ||
|
||
// Bad as users couldn't insert any documents into the collection | ||
it('finds empty range "5 < value <= 5" is not useful', function() { |
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.
"finds ... is not useful" - I don't quite understand that sentence. Can we rephrase all of these to make clearer what we test for? Maybe use accepts
/rejects
as verbs and structure like this:
describe('ValidationStore', () => {
describe('Range Rule', () => {
context('when passing in values that are valid on the server and rule builder UI', () => {
it('rejects empty ranges (5 < value <= 5)', () => {...});
...
});
});
});
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.
Will do, naming things 👍
c048900
to
4ff26fd
Compare
Revert "Revert "Temporarily add range rule in" so partial progress stays hidden" This reverts commit cb9a1cc.
I don't understand where these are coming from, so skip them for now as it's unclear if we might want to go back to a separate shareable repo in future: FIRST ERROR -------------------- ✓ goes into {fetchState: "error"} when receiving an error back TypeError: Cannot set property 'validator' of undefined at Store._deconstructValidatorDoc (/Users/pzrq/Projects/compass/src/internal-packages/validation/lib/stores/index.js:81:7) at _fetchFromServer (/Users/pzrq/Projects/compass/src/internal-packages/validation/lib/stores/index.js:223:27) at Timeout._onTimeout (/Users/pzrq/Projects/compass/test/validation.store.test.js:14:14) at tryOnTimeout (timers.js:224:11) at Timer.listOnTimeout (timers.js:198:5) TypeError: Cannot set property 'validator' of undefined at Store._deconstructValidatorDoc (/Users/pzrq/Projects/compass/src/internal-packages/validation/lib/stores/index.js:81:7) at _fetchFromServer (/Users/pzrq/Projects/compass/src/internal-packages/validation/lib/stores/index.js:223:27) at Timeout._onTimeout (/Users/pzrq/Projects/compass/test/validation.store.test.js:14:14) at tryOnTimeout (timers.js:224:11) at Timer.listOnTimeout (timers.js:198:5) 1) goes into {fetchState: "error"} when receiving an invalid validator doc Failed with exit code: 1 SECOND ERROR ------------------------- ✓ goes into {fetchState: "error"} when receiving an error back - goes into {fetchState: "error"} when receiving an invalid validator doc TypeError: Cannot set property 'validator' of undefined at Store._deconstructValidatorDoc (/Users/pzrq/Projects/compass/src/internal-packages/validation/lib/stores/index.js:81:7) at _fetchFromServer (/Users/pzrq/Projects/compass/src/internal-packages/validation/lib/stores/index.js:223:27) at Timeout._onTimeout (/Users/pzrq/Projects/compass/test/validation.store.test.js:14:14) at tryOnTimeout (timers.js:224:11) at Timer.listOnTimeout (timers.js:198:5) TypeError: Cannot set property 'validator' of undefined at Store._deconstructValidatorDoc (/Users/pzrq/Projects/compass/src/internal-packages/validation/lib/stores/index.js:81:7) at _fetchFromServer (/Users/pzrq/Projects/compass/src/internal-packages/validation/lib/stores/index.js:223:27) at Timeout._onTimeout (/Users/pzrq/Projects/compass/test/validation.store.test.js:14:14) at tryOnTimeout (timers.js:224:11) at Timer.listOnTimeout (timers.js:198:5) 1) goes into {fetchState: "error"} when the result is not an object { AssertionError: expected 1 to equal 2 at Timeout.setTimeout (/Users/pzrq/Projects/compass/test/validation.store.test.js:110:35) at tryOnTimeout (timers.js:224:11) at Timer.listOnTimeout (timers.js:198:5) message: 'expected 1 to equal 2', showDiff: true, actual: 1, expected: 2 } AssertionError: expected 1 to equal 2 at Timeout.setTimeout (/Users/pzrq/Projects/compass/test/validation.store.test.js:110:35) at tryOnTimeout (timers.js:224:11) at Timer.listOnTimeout (timers.js:198:5) 2) "after each" hook
Lowers the complexity of queryToParams from 14 to 12.
Fixes TODO.
Infinity is dropped as the empty clause is better and so we don't have to represent it in the GUI.
At a mongo shell: use validation; > db.runCommand({collMod: 'validation', validator: {"age": {$gte:0.01,$lt:5000 }, "phone_no": { "$regex": "^[0-9 ]+$", "$options": "mx" } }});
At a mongo shell: use validation; > db.runCommand({collMod: 'validation', validator: {"age": {$gte:0.01,$lt:5000 }, "phone_no": { "$regex": "^[0-9 ]+$", "$options": "mx" } }});
Full range component to come in a JIRA linked to COMPASS-156 or COMPASS-235.
Coming in COMPASS-235, definitely working on that today so we can stop this back and forth partial stuff.
Wasn't found in earlier string replace in COMPASS-156
@rueckstiess Please review, thanks.