mill.testkit
Members list
Type members
Classlikes
Attributes
- Source
- BashTokenizer.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BashTokenizer.type
Attributes
- Source
- ExampleParser.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ExampleParser.type
A variant of IntegrationTester, ExampleTester works the same way except the commands used to test the project come from a /** Usage ... */
comment inside the project's build.mill
file. This is intended to make the build.mill
file usable as documentation, such that a reader can skim the build.mill
and see both the build configuration and the commands they themselves can enter at the command line to exercise it.
A variant of IntegrationTester, ExampleTester works the same way except the commands used to test the project come from a /** Usage ... */
comment inside the project's build.mill
file. This is intended to make the build.mill
file usable as documentation, such that a reader can skim the build.mill
and see both the build configuration and the commands they themselves can enter at the command line to exercise it.
Implements a bash-like test DSL for educational purposes, parsed out from a Example Usage
comment in the example's build.mill
file. Someone should be able to read the Example Usage
comment and know roughly how to execute the example themselves.
Each empty-line-separated block consists of one command (prefixed with >
) and zero or more output lines we expect to get from the command (either stdout or stderr):
-
If there are no expected output lines, we do not perform any assertions on the output of the command
-
Output lines can be prefixed by
error:
to indicate we expect that command to fail. -
...
can be used to indicate wildcards, which match anything. These can be used alone as the entire line, or in the middle of another line -
Every line of stdout/stderr output by the command must match at least one line of the expected output, and every line of expected output must match at least one line of stdout/stderr. We ignore ordering of output lines.
For teaching purposes, the output lines do not show the entire output of every command, which can be verbose and confusing. They instead contain sub-strings of the command output, enough to convey the important points to a learner. This is not as strict as asserting the entire command output, but should be enough to catch most likely failure modes
Because our CI needs to run on Windows, we cannot rely on just executing commands in the bash
shell, and instead we implement a janky little interpreter that reads the command lines and does things in-JVM in response to each one.
Attributes
- Companion
- class
- Source
- ExampleTester.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ExampleTester.type
Attributes
- Companion
- object
- Source
- ExampleTester.scala
- Supertypes
Attributes
- Source
- IntegrationTestSuite.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Helper meant for executing Mill integration tests, which runs Mill in a subprocess against a folder with a build.mill
and project files. Provides APIs such as eval to run Mill commands and out to inspect the results on disk. You can use modifyFile or any of the OS-Lib os.*
APIs on the workspacePath to modify project files in the course of the test.
Helper meant for executing Mill integration tests, which runs Mill in a subprocess against a folder with a build.mill
and project files. Provides APIs such as eval to run Mill commands and out to inspect the results on disk. You can use modifyFile or any of the OS-Lib os.*
APIs on the workspacePath to modify project files in the course of the test.
Value parameters
- daemonMode
-
Whether to run Mill in client-server mode. If
false
, Mill is run with--no-server
- millExecutable
-
What Mill executable to use.
- workspaceSourcePath
-
The folder in which the
build.mill
and project files being tested comes from. These are copied into a temporary folder and are not modified during tests
Attributes
- Companion
- object
- Source
- IntegrationTester.scala
- Supertypes
-
trait Impltrait IntegrationTesterBasetrait AutoCloseableclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Source
- IntegrationTester.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
IntegrationTester.type
Attributes
- Source
- IntegrationTesterBase.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
A wrapper of RootModule0 meant for easy instantiation in test suites.
A wrapper of RootModule0 meant for easy instantiation in test suites.
Attributes
- Source
- TestBaseModule.scala
- Supertypes
-
class RootModule0trait BaseModuleApitrait Moduletrait ModuleApitrait Wrapperclass BaseClasstrait Cachertrait Cacherclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Source
- UnitTester.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
UnitTester.type
Value parameters
- failFast
-
failFast mode enabled
- module
-
The module under test
- threads
-
explicitly used nr. of parallel threads
Attributes
- Companion
- object
- Source
- UnitTester.scala
- Supertypes
-
trait AutoCloseableclass Objecttrait Matchableclass Any
Attributes
- Source
- UtestExampleTestSuite.scala
- Supertypes
-
class TestSuitetrait TestSuitePlatformSpecifictrait TestSuiteVersionSpecifictrait Executorclass Objecttrait Matchableclass AnyShow all
- Self type
Attributes
- Source
- UtestIntegrationTestSuite.scala
- Supertypes
-
trait IntegrationTestSuiteclass TestSuitetrait TestSuitePlatformSpecifictrait TestSuiteVersionSpecifictrait Executorclass Objecttrait Matchableclass AnyShow all
Value members
Concrete methods
Attributes
- Source
- helpers.scala
Attributes
- Source
- helpers.scala
Adds the provided clues to the thrown utest.AssertionError.