v0.1.18
Filter tests with --test-only
It is now possible to filter test suites with the --test-only
option.
//> using lib "org.scalameta::munit::1.0.0-M7"
package tests.only
class Tests extends munit.FunSuite {
test("bar") {
assert(2 + 2 == 5)
}
test("foo") {
assert(2 + 3 == 5)
}
test("foo-again") {
assert(2 + 3 == 5)
}
}
package tests
class HelloTests extends munit.FunSuite {
test("hello") {
assert(2 + 2 == 4)
}
}
scala-cli test BarTests.scala HelloTests.scala --test-only 'tests.only*'
# tests.only.Tests:
# ==> X tests.only.Tests.bar 0.037s munit.FailException: ~/project/BarTests.scala:5 assertion failed
# 4: test("bar") {
# 5: assert(2 + 2 == 5)
# 6: }
# at munit.FunSuite.assert(FunSuite.scala:11)
# at tests.only.Tests.$init$$$anonfun$1(BarTests.scala:5)
# at tests.only.Tests.$init$$$anonfun$adapted$1(BarTests.scala:6)
# + foo 0.004s
# + foo-again 0.001s
Filtering particular tests by name requires passing args to the test framework.
For example, with munit
:
scala-cli test BarTests.scala HelloTests.scala --test-only 'tests.only*' -- '*foo*'
# tests.only.Tests:
# + foo 0.032s
# + foo-again 0.001s
Accept authenticated proxy params via Scala CLI config
If you can only download artifacts through an authenticated proxy, it is now possible to configure it
with the config
subcommand.
scala-cli config httpProxy.address https://proxy.company.com
scala-cli config httpProxy.user _encoded_user_
scala-cli config httpProxy.password _encoded_password_
Replace _encoded_user_
and _encoded_password_
by your actual user and password, following
the password option format. They should typically look like env:ENV_VAR_NAME
, file:/path/to/file
, or command:command to run
.
Added by @alexarchambault in #1593
Support for running Markdown sources from zipped archives and gists
It is now possible to run .md
sources inside a .zip
archive.
Same as with directories, .md
sources inside zipped archives are ignored by default, unless
the --enable-markdown
option is passed.
scala-cli archive-with-markdown.zip --enable-markdown
This also enables running Markdown sources fom GitHub gists, as those are downloaded by Scala CLI as zipped archives.
scala-cli https://gist.github.com/Gedochao/6415211eeb8ca4d8d6db123f83f0f839 --enable-markdown
It is also possible to point Scala CLI to a .md
file with a direct URL.
scala-cli https://gist.githubusercontent.com/Gedochao/6415211eeb8ca4d8d6db123f83f0f839/raw/4c5ce7593e19f1390555221e0d076f4b02f4b4fd/example.md
Support for running piped Markdown sources
Instead of passing paths to your Markdown sources, you can also pipe your code via standard input:
echo '# Example Snippet
```scala
println("Hello")
```' | scala-cli _.md
Support for running Markdown snippets
It is now possible to pass Markdown code as a snippet directly from the command line.
scala-cli run --markdown-snippet '# Markdown snippet
with a code block
```scala
println("Hello")
```'
Customize exported Mill project name
It is now possible to pass the desired name of your Mill project to the export
sub-command
with the --project
option.
scala-cli export . --mill -o mill-proj --project project-name
Added by @carlosedp in #1563
Export Scala compiler options to Mill projects
It is now possible to export scalac
options from a Scala CLI project to Mill with the export
sub-command.
Other changes
Fixes
- Fix overriding settings from tests by @alexarchambault in #1566
- Print compilation failed in watch mode too in test command by @alexarchambault in #1548
- Fix error message when running JVM launcher from Java 8 by @alexarchambault in #1575
- Fix
using
directives for Markdown inputs by @Gedochao in #1598 - Fix - clean up only homebrew-scala-experimental directory by @lwronski in #1615
- Warn users when pushing to Sonatype with missing credentials or params by @alexarchambault in #1545
- Warning for multiple files with using directives by @wleczny in #1591
- Make package --python work by @alexarchambault in #1531
- Better revolver output by @alexarchambault in #1614
- Make
PackageTestsDefault.reuse run native binary
more robust by @lwronski in #1621
Documentation updates
- Add some explanations on implicit sub-commands in
-help
by @Gedochao in #1587 - Runner specification by @romanowski in #1445
- Install documentation update by @wleczny in #1595
- Document recent features & changes affecting working with Markdown inputs by @Gedochao in #1606
- Improve docs coverage with
sclicheck
by @Gedochao in #1612 - Reduce ignore tags in the docs snippets by @Gedochao in #1617
Build and internal changes
- Remove superfluous annotation by @alexarchambault in #1567
- Decompose & refactor
Inputs
by @Gedochao in #1565 - Disable create PGP key test on Windows CI by @alexarchambault in #1588
- Switch to Scala 3-based case-app by @alexarchambault in #1568
- Remove cli-options module by @alexarchambault in #1552
- Enable to force using jvm signing launcher for native launcher of scala-cli by @lwronski in #1597
- Run warm up test before running default tests by @lwronski in #1599
- Make DefaultTests more robust by @alexarchambault in #1613
Updates & maintenance
- Update scala-cli.sh launcher for 0.1.17 by @github-actions in #1564
- Update zip-input-stream to 0.1.1 by @scala-steward in #1573
- Update coursier-jvm_2.13, ... to 2.1.0-RC1 by @scala-steward in #1572
- Update mill-main to 0.10.9 by @scala-steward in #1571
- Update test-runner, tools to 0.4.8 by @scala-steward in #1574
- Update case-app_2.13 to 2.1.0-M21 by @scala-steward in #1570
- Bump VirtusLab/scala-cli-setup from 0.1.16 to 0.1.17 by @dependabot in #1579
- Bump Ammonite to 2.5.5-17-df243e14 & Scala to 3.2.1 by @Gedochao in #1586
- Update scala-cli-signing to 0.1.13 by @alexarchambault in #1569
- Update coursier-jvm_2.13, ... to 2.1.0-RC2 by @scala-steward in #1590
- Update scalajs-sbt-test-adapter_2.13 to 1.11.0 by @scala-steward in #1477
- Update slf4j-nop to 2.0.4 by @scala-steward in #1596
- Update jsoniter-scala-core_2.13 to 2.18.0 by @scala-steward in #1608
- Update test-runner, tools to 0.4.9 by @scala-steward in #1610
- Update Bloop to 1.5.4-sc-4 by @alexarchambault in #1622
- Update scalajs-sbt-test-adapter_2.13 to 1.12.0 by @scala-steward in #1609
New Contributors
- @carlosedp made their first contribution in #1563
Full Changelog: v0.1.17...v0.1.18