Skip to content

Commit

Permalink
Remove deprecated IntegrationTest config from doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Friendseeker committed Oct 29, 2024
1 parent 5a046a7 commit f4ab690
Showing 1 changed file with 0 additions and 75 deletions.
75 changes: 0 additions & 75 deletions src/reference/02-DetailTopics/02-Configuration/14-Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,81 +248,6 @@ to enable integration tests. The second shows how to define a customized
test configuration. This allows you to define multiple types of tests
per project.

#### Integration Tests

The following full build configuration demonstrates integration tests.

```scala
lazy val scalatest = "org.scalatest" %% "scalatest" % "$example_scalatest_version$"

ThisBuild / organization := "com.example"
ThisBuild / scalaVersion := "$example_scala_version$"
ThisBuild / version := "0.1.0-SNAPSHOT"

lazy val root = (project in file("."))
.configs(IntegrationTest)
.settings(
Defaults.itSettings,
libraryDependencies += scalatest % "it,test"
// other settings here
)
```

- `configs(IntegrationTest)` adds the predefined integration test
configuration. This configuration is referred to by the name `it`.
- `settings(Defaults.itSettings)` adds compilation, packaging,
and testing actions and settings in the IntegrationTest
configuration.
- `settings(libraryDependencies += scalatest % "it,test")` adds scalatest to both the
standard test configuration and the integration test configuration
it. To define a dependency only for integration tests, use "it" as
the configuration instead of "it,test".

The standard source hierarchy is used:

- `src/it/scala` for Scala sources
- `src/it/java` for Java sources
- `src/it/resources` for resources that should go on the integration
test classpath

The standard testing tasks are available, but must be prefixed with
`IntegrationTest/`. For example to run all integration tests:

```
> IntegrationTest/test
```

Or to run a specific test:

```
> IntegrationTest/testOnly org.example.AnIntegrationTest
```

Similarly the standard settings may be configured for the
`IntegrationTest` configuration. If not specified directly, most
`IntegrationTest` settings delegate to `Test` settings by default. For
example, if test options are specified as:

```scala
Test / testOptions += ...
```

then these will be picked up by the `Test` configuration and in turn by
the `IntegrationTest` configuration. Options can be added specifically
for integration tests by putting them in the `IntegrationTest`
configuration:

```scala
IntegrationTest / testOptions += ...
```

Or, use `:=` to overwrite any existing options, declaring these to be
the definitive integration test options:

```scala
IntegrationTest / testOptions := Seq(...)
```

#### Custom test configuration

The previous example may be generalized to a custom test configuration.
Expand Down

0 comments on commit f4ab690

Please sign in to comment.