https://github.com/alopukhov/sybok
Sybok test engine
https://github.com/alopukhov/sybok
groovy java junit5 sybok testing
Last synced: 9 months ago
JSON representation
Sybok test engine
- Host: GitHub
- URL: https://github.com/alopukhov/sybok
- Owner: alopukhov
- License: apache-2.0
- Created: 2022-05-03T15:12:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-15T20:32:49.000Z (almost 4 years ago)
- Last Synced: 2023-09-15T09:20:00.168Z (over 2 years ago)
- Topics: groovy, java, junit5, sybok, testing
- Language: Java
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](LICENSE)
[](https://mvnrepository.com/artifact/io.github.alopukhov.sybok/sybok-engine)
# Sybok
Sybok is a test engine for well-known JUnit platform.
The main goal is running groovy test scripts on junit platform without compilation using
[JUnit Console](https://junit.org/junit5/docs/snapshot/user-guide/#running-tests-console-launcher).
# Getting started
Just add Sybok to your runtime classpath and you are ready to go.
Library is available at maven central.
Grab it With gradle:
```groovy
runtimeOnly "io.github.alopukhov.sybok:sybok-engine:${sybokVersion}"
```
Or with maven:
```xml
io.github.alopukhov.sybok
sybok-engine
${sybokVersion}
runtime
```
# Configuration options
* `sybok.script-roots` comma separated list of paths to script roots folders.
Those folders must exist. Specifying some directory and its ancestor is prohibited.
For example following config considered illegal: `./specs/,./specs/a/b`
* `sybok.delegate-engine-ids` comma separated list of engines ids to use.
Empty list (default) will use all engines found on classpath except sybok itself.
* `sybok.alter-classloader` (defaults to `false`) alters Thread Context Classloader.
Use it if delegate engine fails to discover or execute test classes.
* `sybok.delegate..alter-classloader` more finegrained approach to change classloader.
For example, TestNG will fail to run tests during execution phase.
Setting `sybok.delegate.testng.alter-classloader` may be helpfull.
When using JUnit Console you may specify them via `--config` option, e.g.
`--config sybok.script-roots=./specs/`
# Scripts directory structure
Sybok does not enforce any particular folder structure.
However, there are some basic restriction:
* Package declarations must match directory structure
* Only single non-nested class may be declared in a file
* Declared classname must match filename
* Declaring same class under multiple roots is prohibited
# Selecting tests
Following test selectors are supported:
* `-d, --select-directory` traverses specified directories to find tests.
Directories not under script roots will be silently ignored.
* `-p, --select-package` traverse files in all script roots belonging to specified package.
Empty (root) package will be ignored - use directory selectors instead.
* `-f, --select-file` select specific file for test discovery.
Files not under script roots will be silently ignored.
* `-c, --select-class` looks for specified class inside test roots.
First two options also takes into account package and classname include/exclude filters.
File and class selectors ignores those filters.
---
:grey_exclamation: Default JUnit Console include classname pattern is `^(Test.*|.+[.$]Test.*|.*Tests?)$`.
Override it or name your test classes according to it.
---
# Example
See [sybok-example](https://github.com/alopukhov/sybok-example) repo for example project.