Skip to content

Commit 1a6839e

Browse files
Remove JUnit 5 @Disabled annotations when running tests via Gradle (exercism#2363)
* Add support for JUnit 5 in CI This adds support for practice exercises using JUnit 5 by updating the Gradle build script to automatically remove `@Disabled` annotations used by JUnit 5 to skip tests. * Remove unused scripts from `bin` directory This removes scripts that were previously used to run tests in CI (presumably). Since this is now handled completely by Gradle, the scripts are no longer used.
1 parent 6b2befe commit 1a6839e

7 files changed

Lines changed: 5 additions & 296 deletions

File tree

CONTRIBUTING.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
* [Getting Familiar With the Codebase](#getting-familiar-with-the-codebase)
1111
* [The `exercises` Module](#the-exercises-module)
1212
* [The Problem Submodules](#the-problem-submodules)
13-
* [Advanced: Complete Local Setup](#advanced--complete-local-setup)
14-
* [Prerequisites](#prerequisites)
15-
* [Debian Linux](#debian-linux)
16-
* [macOS](#macos)
1713
* [Adding a New Exercise](#adding-a-new-exercise)
1814
* [Updating the READMEs](#updating-the-readmes)
1915
* [Checking tests are up to date](#checking-tests-are-up-to-date)
@@ -148,23 +144,6 @@ Each problem/submodule has three source sets:
148144
* `.meta/src/reference/java/` — a reference solution that passes all the tests
149145
* `src/main/java/` — starter source file(s).
150146

151-
----
152-
153-
## Advanced: Complete Local Setup
154-
155-
### Prerequisites
156-
Before you proceed, please ensure that you have `jq` (library that parses JSON) & `ruby` installed on your machine.
157-
158-
#### Debian Linux
159-
`sudo apt-get install jq ruby-full`
160-
161-
#### macOS
162-
`brew install jq ruby`
163-
164-
If you are going to make significant contribution(s) to the track, you might find it handy to have a complete local installation of exercism on your computer. This way, you can run the full suite of tests without having to create/update a PR.
165-
166-
The easiest way to achieve this is simply use the `bin/journey-test.sh` script. However, you may want to perform other tests, depending on what you are doing. You can do so by duplicating the setup performed by the `bin/journey-test.sh` script.
167-
168147
## Adding a New Exercise
169148

170149
The easiest way to add a new exercise to the Java track is to port an exercise from another track.

bin/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

bin/build-jq.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

bin/journey-test.sh

Lines changed: 0 additions & 155 deletions
This file was deleted.

bin/run-journey-test-from-ci.sh

Lines changed: 0 additions & 82 deletions
This file was deleted.

bin/unit-tests.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

exercises/build.gradle

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@ subprojects {
1212

1313
apply plugin: "checkstyle"
1414

15-
// Add a task that copies test source files into a build directory. All @Ignore annotations
16-
// are removed during this copying, so that when we run the copied tests, none are skipped and
17-
// all should execute.
18-
//
19-
// Note that journey-test.sh also strips @Ignore annotations using sed. The
20-
// stripping implementations here and in journey-test.sh should be kept
21-
// consistent.
22-
task copyTestsFilteringIgnores(type: Copy) {
15+
// Add a task that copies test source files into a build directory.
16+
// All @Ignore and @Disabled annotations are removed during this copying,
17+
// so that when we run the copied tests, none are skipped and all should execute.
18+
tasks.register('copyTestsFilteringIgnores', Copy) {
2319
from "src/test/java"
2420
into generatedTestSourceDir
2521
filter { line ->
26-
line.contains("@Ignore") ? null : line
22+
line ==~ /.*@(Ignore|Disabled).*/ ? null : line
2723
}
2824
}
2925

0 commit comments

Comments
 (0)