Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

WIP: restructure tests #425

Merged
merged 5 commits into from
May 13, 2016
Merged

Conversation

jvican
Copy link
Member

@jvican jvican commented May 13, 2016

  • This change is useful for two reasons: it gives us a more consistent
    structure of the tests that allow fast browsing through the test suite
    and it also allow us to distinguish which tests are missing (e.g. tests
    that check the binary format but not the json format). Also, an important
    point is that this is the first step to port the test suite to Scalajs and
    reuse most of its components. For doing that, we're importing staticOnly
    all over the place and therefore we figure out which tests are Scalajs friendly
    and which are not.

Disclaimer: the Scalajs restructure will be also done in this PR.

Changes

Add staticOnly flag to most of binary tests

  • Binary tests are now compiled with the static flag, however there are
    still some bad boys that need to be moved to the JVM folder, since they
    need reflection somehow.
  • Rename a rebel test filename to follow current nomenclature.

Group better the tests

  • Rename logic to generation to store all the tests related with the
    correct generation of picklers for any type.
  • Move generator, pickler, tags and internal to generation.

Rename tests to specify their own format

  • When the test suite is run, it's confusing to know figure out the failed
    test since some tests are repeated for different formats
    (binary and json) with the same test name.

Merge the tests and change the overall structure

  • This change is useful for two reasons: it gives us a more consistent
    structure of the tests that allow fast browsing through the test suite
    and it also allow us to distinguish which tests are missing (e.g. tests
    that check the binary format but not the json format).
  • Also, it removes ~3 repeated tests and it adds ~3 test suites. One of
    them checks that our picklers are thread-safe in both formats.
  • Some renames have been made to make clearer what tests are supposed to
    do, and therefore they are a little bit more verbose. A little subset
    has the name of the test class (and not only the file) changed, but
    this is practically unimportant.
  • Lastly, the modularity of the tests will help to have more granularity
    to select tests for the scalajs support. That is the next step.

Update scalatest and fix scalatest issue 873

  • Update to M15 of latest release of scalatest that is now ScalaJS
    compatible.
  • Make sure sbt recognises the dependencies as test runners.
  • Fix scalatest issue 873, caused by a bad interaction between the
    assert macro and our generated picklers and unpicklers. The assert
    macro is going to cache the condition that is testing and is going to
    convert it to a String to show it to the user in case of failure.
    If the condition that is evaluated by assert uses pickle and
    unpickle and the generated picklers/unpicklers are very big, they
    surpass the 65k length limit imposed by the code generators (both in
    ScalaJS and the JVM) since they store the length in two bytes.

jvican added 5 commits May 7, 2016 18:05
* Update to M15 of latest release of scalatest that is now ScalaJS
  compatible.

* Make sure sbt recognises the dependencies as test runners.

* Fix scalatest issue 873, caused by a bad interaction between the
  assert macro and our generated picklers and unpicklers. The assert
  macro is going to cache the condition that is testing and is going to
  convert it to a `String` to show it to the user in case of failure.
  If the condition that is evaluated by assert uses `pickle` and
  `unpickle` and the generated picklers/unpicklers are very big, they
  surpass the 65k length limit imposed by the code generators (both in
  ScalaJS and the JVM) since they store the length in two bytes.
* This change is useful for two reasons: it gives us a more consistent
  structure of the tests that allow fast browsing through the test suite
  and it also allow us to distinguish which tests are missing (e.g. tests
  that check the binary format but not the json format).

* Also, it removes ~3 repeated tests and it adds ~3 test suites. One of
  them checks that our picklers are thread-safe in both formats.

* Some renames have been made to make clearer what tests are supposed to
  do, and therefore they are a little bit more verbose. A little subset
  has the name of the test class (and not only the file) changed, but
  this is practically unimportant.

* Lastly, the modularity of the tests will help to have more granularity
  to select tests for the scalajs support. That is the next step.
* When the test suite is run, it's confusing to know figure out
the failed test since some tests are repeated for different formats
(binary and json) with the same test name.
* Rename `logic` to `generation` to store all the tests related with the
correct generation of picklers for any type.

* Move `generator`, `pickler`, `tags` and `internal` to `generation`.
* Binary tests are now compiled with the static flag, however there are
still some bad boys that need to be moved to the JVM folder, since they
need reflection somehow.

* Rename a rebel test filename to follow current nomenclature.
@@ -0,0 +1,4 @@
# Which tests should I write here?

These tests represent bugs that have been filed in the issue
Copy link
Contributor

Choose a reason for hiding this comment

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

I like these distinctions, with the caveat that perhaps these should be called 'regression tests' to prevent bugs from reopening.

@jsuereth
Copy link
Contributor

Looks great!

@jsuereth jsuereth merged commit 34fa143 into scala:0.11.x May 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants