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

Shrink our gigantic tests! #115

Merged
merged 5 commits into from May 17, 2016

Conversation

Projects
None yet
4 participants
@wafflespeanut
Copy link
Member

wafflespeanut commented May 6, 2016

This makes use of a simple wrapper around the JSON object and marks stuff whenever we 'get' something from the dictionary (using []). This can help shrink the gigantic tests we currently have (which has a hell lot of unused key/val)

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 6, 2016

Heads up! This PR modifies the following files:

  • @jdm: helpers.py, eventhandler.py, test.py, json_cleanup.py
@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 6, 2016

gotta fix the flake8 stuff...

@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 6, 2016

It might be worth taking a look at the failed Travis build! 😄

@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 6, 2016

@jdm I think it's still buggy, but well, this is just a prototype. I'm curious whether this would be useful if I make it to work.

@wafflespeanut wafflespeanut force-pushed the wafflespeanut:chop_tests branch from 2b44f8f to e794870 May 7, 2016

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 7, 2016

New code was committed to pull request.

@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 7, 2016

Now, this is progress! (still, 3 tests fail)

@wafflespeanut wafflespeanut force-pushed the wafflespeanut:chop_tests branch from e794870 to 88f34dd May 8, 2016

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 8, 2016

New code was committed to pull request.

@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 8, 2016

All the tests pass now, but I had to put some type conversions to integrate the lint.

@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 8, 2016

After trying to integrate this into highfive (for a while now), I realize that the entire problem lies on creating the tests, where we read the JSON files twice (one for the initial/expected stuff), and the other for payload. I think I should modify the linter to take objects instead of going directly for the file.

@wafflespeanut wafflespeanut force-pushed the wafflespeanut:chop_tests branch from 88f34dd to c877682 May 8, 2016

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 8, 2016

New code was committed to pull request.

@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 8, 2016

  • fixed the linter for flagging only the stuff in payload
  • avoided reading the test JSONs twice
  • added flag to warn/overwrite the nodes in test files

only the command-line argument is left to go...

@wafflespeanut wafflespeanut force-pushed the wafflespeanut:chop_tests branch from c877682 to eec2bbc May 8, 2016

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 8, 2016

New code was committed to pull request.

@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 8, 2016

I'm finally satisfied with the output 😄

@wafflespeanut wafflespeanut changed the title [WIP] Shrink our gigantic tests! Shrink our gigantic tests! May 8, 2016

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented May 10, 2016

☔️ The latest upstream changes (presumably #118) made this pull request unmergeable. Please resolve the merge conflicts.

@wafflespeanut wafflespeanut force-pushed the wafflespeanut:chop_tests branch from eec2bbc to 25ac3dd May 10, 2016

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 10, 2016

New code was committed to pull request.

@wafflespeanut wafflespeanut force-pushed the wafflespeanut:chop_tests branch from 25ac3dd to 8ccdbc2 May 11, 2016

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 11, 2016

New code was committed to pull request.

@wafflespeanut wafflespeanut force-pushed the wafflespeanut:chop_tests branch from 8ccdbc2 to d0d9b57 May 11, 2016

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 11, 2016

New code was committed to pull request.

2 similar comments
@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 11, 2016

New code was committed to pull request.

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 11, 2016

New code was committed to pull request.

@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 11, 2016

This is ready for review!

@wafflespeanut wafflespeanut force-pushed the wafflespeanut:chop_tests branch from faab8bc to 78536be May 16, 2016

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 16, 2016

New code was committed to pull request.

@wafflespeanut wafflespeanut force-pushed the wafflespeanut:chop_tests branch from 78536be to 9371c59 May 16, 2016

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 16, 2016

New code was committed to pull request.

@@ -55,7 +55,7 @@ def on_pr_opened(self, api, payload):
pr = payload["pull_request"]
# If the pull request already has an assignee,
# don't try to set one ourselves.
if pr["assignee"] != None:
if pr["assignee"] != None: # NOQA (silence flake8 here)

This comment has been minimized.

@jdm

jdm May 16, 2016

Member

What is it complaining about?

This comment has been minimized.

@wafflespeanut

wafflespeanut May 16, 2016

Author Member

flake8 prefers is not None, but we need != to call our overridden __ne__ method (the former checks for an exact match of the object, which will fail during testing)

@jdm

This comment has been minimized.

Copy link
Member

jdm commented May 16, 2016

The need for str(foo) and int(foo) in various places is disappointing. Is there no way around that?

@wafflespeanut wafflespeanut force-pushed the wafflespeanut:chop_tests branch from 9371c59 to e4b650e May 17, 2016

@highfive

This comment has been minimized.

Copy link
Collaborator

highfive commented May 17, 2016

New code was committed to pull request.

@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 17, 2016

True, they are bad, but I couldn't find a way around them. I've fixed some of them, and now we have only three situations (in regex matching) where str(foo) occurs. Python's re methods look pretty strict, that they accept only string/unicode, which prevents us from overriding anything 😞

@jdm jdm merged commit 7f3112c into servo:master May 17, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jdm

This comment has been minimized.

Copy link
Member

jdm commented May 17, 2016

Thanks!

@wafflespeanut wafflespeanut deleted the wafflespeanut:chop_tests branch May 18, 2016

@wafflespeanut

This comment has been minimized.

Copy link
Member Author

wafflespeanut commented May 18, 2016

Thanks for reviewing it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment