Skip to content

Add documentation for new parallel testing suite #2153

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

Merged
merged 1 commit into from
Mar 31, 2017

Conversation

felixmulder
Copy link
Contributor

No description provided.

```

Currently this will re-run some unit tests and do some preprocessing because of
the way partest has been set up.
As you can see, the `filterTest` task takes a regular expression as its
Copy link
Contributor

Choose a reason for hiding this comment

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

The filterTest task takes a regular expression as its argument. For example, you could run a negative and a positive test with:

> filterTest (.*pos/t210.scala)|(.*neg/t210.scala)

Running all tests in Dotty is as simple as:

```bash
$ sbt
Copy link
Contributor

Choose a reason for hiding this comment

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

$ sbt test?


## Unit tests
These tests can be found in `<sub-project>/test` and are used to check
functionality of specific parts of the codebase in isolation, such e.g.
Copy link
Contributor

Choose a reason for hiding this comment

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

such e.g., very test, wow

> testOnly absolute.path.to.TestClass
```

To filter out individual tests you can use:
Copy link
Contributor

Choose a reason for hiding this comment

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

You can further restrict the executed tests to a subset of TestClass methods as follows:

```

## Integration tests
These tests are source files compiled by Dotty with an expected amount of
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests are Scala source files expected to compile with Dotty (pos tests), along with their expected output (run tests) or errors (neg tests).

- `partest` will bootstrap the compiler, run the unit tests and then the
integration tests

## dotty partest
Copy link
Contributor

Choose a reason for hiding this comment

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

dotty test suite?


## dotty partest
The new test suite will soon become the standard integration test runner. It
has several advantages over the old implementation.
Copy link
Contributor

Choose a reason for hiding this comment

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

:

- integrates with JUnit, without the need for setup
- reuses the same VM for compilation
- can filter tests
- much faster than scala-partest (almost 2x)
Copy link
Contributor

Choose a reason for hiding this comment

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

runs much faster (almost 2x)


- integrates with JUnit, without the need for setup
- reuses the same VM for compilation
- can filter tests
Copy link
Contributor

Choose a reason for hiding this comment

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

allows filtering of tests

by using:

```bash
> filterTest .*i2147.scala
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about using testOnly for both by class name and by regex filtering?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that would be cool. Please implement :trollface:

@felixmulder felixmulder force-pushed the topic/dottest-userman branch from 0e772dd to 29ff5ad Compare March 30, 2017 15:42
as follows:

```bash
> testOnly absolute.path.to.TestClass -- *methodName
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain the * here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

> testOnlyt path.toTestClass -- -z subStringOfMethod
> testOnlyt path.toTestClass -- -t exactMethodName

From what I gather the *methodName is equivalent to -z methodName

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I include this instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

I not sure it's better, but it might be a bit confusing to have both .* and * in the such similar places

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Decided to merge this so that @abeln can base his docs update on it.

I'll get to the docs again once I've fixed the deadlock situation.

@felixmulder felixmulder merged commit 2fceb2d into scala:master Mar 31, 2017
@felixmulder felixmulder deleted the topic/dottest-userman branch March 31, 2017 14:43
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