Skip to content

Add warning about test files in publish docs #3486

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
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions website/docs/commands/publishing/publish-local.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ Publishing io.github.scala-cli:hello-scala-cli_3:0.1.0-SNAPSHOT
~/.ivy2/local/io.github.scala-cli/hello-scala-cli_3/0.1.0-SNAPSHOT/
```

:::caution
The `publish local` sub-command does not currently support publishing of the test scope.
This includes any file that is placed in `test` directory or with the `.test.scala` suffix.

Read more about test sources in [testing documentation](../test.md#test-sources).
:::

</ChainedSnippets>

## Required settings
Expand Down
7 changes: 7 additions & 0 deletions website/docs/commands/publishing/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,10 @@ Publishing io.github.scala-cli:hello-scala-cli_3:0.1.0-SNAPSHOT
```

</ChainedSnippets>

:::caution
The `publish local` sub-command does not currently support publishing of the test scope.
This includes any file that is placed in `test` directory or with the `.test.scala` suffix.

Read more about test sources in [testing documentation](../test.md#test-sources).
:::
2 changes: 1 addition & 1 deletion website/docs/commands/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ path (`test/scala/b.scala`) contains a directory named `test`.
Conversely, `scala-cli example/src/test` results in no test sources, since the relative path to `b.scala` does not
contain `test` (the fact that the directory provided as input is named `test` does not make its content a test source).

Directives take precedence over file or path names, so `using target main` can be used to force `test/a.scala`
Directives take precedence over file or path names, so `using target.scope main` can be used to force `test/a.scala`
or `a.test.scala` to not be treated as tests.

As a rule of thumb, we recommend naming all of your test files with the `.test.scala` suffix.
Expand Down
Loading