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

Refactor common test suite #377

Merged
merged 4 commits into from
Mar 7, 2017

Conversation

iainbeeston
Copy link
Contributor

This pull request contains a number of improvements to how we use the common test suite:

  1. Ignored tests from the common test suite are now stored in yaml file (rather than a large ruby hash)
  2. We no longer abort running the tests if the common test suite cannot be updated (ie. when there is no internet connection)
  3. Tests in the common test suite that are part of the core spec (ie. not optional) are now skipped rather than ignored
  4. It ignores a number of new failing tests in draft6

Please see the commit messages for more details of each change

With draft6 coming we have a lot more ignored tests (for now, until we
can fix the code to support new features). Rather than just add these
all onto the current hash of ignored tests, I've refactored them out
to a yaml file.

I've also changed how we ignore tests that we don't
support. Previously any test that we didn't support simply didn't have
a test created for it, in the test suite. Instead I have changed it so
that only optional tests are handled in this way. Non-optional (ie
core) tests that we don't support are skipped instead, so they are
visible to anyone running the tests, and so that we don't forget that
we should implement those at a future date.
When the default rake task is run (which is the standard way to run
the tests) we always update the common test suite before running the
tests. Unfortunately, if the computer running the tests has no
internet access, this update will fail and then the tests never run.

I've changed this so that if the update to the common test suite
fails, we display an error then carry on with the rest of the test
suite.
For quite while we've made the test rake task update the common test
suite every time it's run, to stop the test suite from becoming
out-of-date. However, the downside to this is that many pull requests
end up failing due to new tests in the common test suite, rather than
changes in the pull request itself.

I think it'd be best to manually update the common test suite in
future. It should make the test suite more reliable.
@iainbeeston iainbeeston force-pushed the refactor-common-test-suite branch from d7151d0 to 06d1d94 Compare March 7, 2017 09:56
@iainbeeston
Copy link
Contributor Author

@RST-J Do you have time to code review this pull request? It should fix the failing tests in the common test suite and hopefully stop them failing unexpectedly in future

@RST-J RST-J merged commit 9c9719f into voxpupuli:master Mar 7, 2017
@iainbeeston
Copy link
Contributor Author

@RST-J thanks!

iainbeeston added a commit to iainbeeston/json-schema that referenced this pull request Jul 5, 2017
In voxpupuli#377 I made it possible to run the tests without having internet
access. But it seems that in the process I also disabled the code that
downloads the common test suite when you first check out the
codebase. That's bad, but what makes it worse is that travis hasn't
been running the common test suite because of it.

This changes the behaviour so that the tests download the common test
suite (but does not update it) before running. If you don't have
internet access it continues without it. To update the common test
suite to the latest version, you now need to run
`UPDATE_TEST_SUITE=true rake download_common_tests`.
iainbeeston added a commit to iainbeeston/json-schema that referenced this pull request Jul 5, 2017
In voxpupuli#377 I made it possible to run the tests without having internet
access. But it seems that in the process I also disabled the code that
downloads the common test suite when you first check out the
codebase.

This changes the behaviour so that if you run the test suite and you
have internet access the common test suite is automatically
downloaded. If you don't have internet access it continues without
it. To update the common test suite to the latest version, you now
need to run the tests with the `UPDATE_TEST_SUITE` env var set.
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