conductor-oss / conductor-oss/conductor

EPIC: Replace Groovy/Spock test-harness with plain Java + JUnit 5

Closed
#1,233 1 comment 0 reactions 1 assignee Claimed by @nthmost-orkes View on GitHub
enhancement java tests
Dominant language
Java
Stars
32.2k
Forks
1k
Avg merge
2d 5h
Merged PRs (30d)
41

Description

## Background

The `test-harness` module currently uses Spock + Groovy for all integration tests. This creates several problems:

- **Flaky races surface as Groovy-specific failures** — the `ConditionNotSatisfied` error from Spock's `with()` blocks gives no indication of which condition failed or what the actual value was.
- **Tooling friction** — Groovy requires a separate compiler invocation, adds IDE Groovy plugin dependencies, and means two languages in one module.
- **Maintenance burden** — contributors unfamiliar with Spock's BDD conventions have to learn a second testing DSL on top of Java.

## What's been done

PR: #1234 (branch `refactor/groovy-to-java-tests`)

- `AbstractSpecification.java` — JUnit 5 + Spring Boot Test + Testcontainers base class replacing `AbstractSpecification.groovy`
- `AbstractResiliencySpecification.java` — replaces the Groovy version
- `WorkflowTestUtil.java` — all poll/complete/fail helpers ported; return type changed from Spock `Tuple` to `Task` directly
- All 32 Groovy specs converted to Java JUnit 5; module compiles clean
- Groovy plugin, groovy-all, spock-core, spock-spring, testcontainers:spock removed from `test-harness/build.gradle`

## Spec checklist

- [x] `SimpleWorkflowSpec` → `SimpleWorkflowTest`
- [x] `DecisionTaskSpec` → `DecisionTaskTest`
- [x] `DoWhileSpec` → `DoWhileTest`
- [x] `DynamicForkJoinSpec` → `DynamicForkJoinTest`
- [x] `EventTaskSpec` → `EventTaskTest`
- [x] `ExclusiveJoinSpec` → `ExclusiveJoinTest`
- [x] `ExternalPayloadStorageSpec` → `ExternalPayloadStorageTest`
- [x] `FailureWorkflowSpec` → `FailureWorkflowTest`
- [x] `ForkJoinSpec` → `ForkJoinTest`
- [x] `HierarchicalForkJoinSubworkflowRerunSpec` → `HierarchicalForkJoinSubworkflowRerunTest`
- [x] `HierarchicalForkJoinSubworkflowRestartSpec` → `HierarchicalForkJoinSubworkflowRestartTest`
- [x] `HierarchicalForkJoinSubworkflowRetrySpec` → `HierarchicalForkJoinSubworkflowRetryTest`
- [x] `InlineSubWorkflowFromExpressionSpec` → `InlineSubWorkflowFromExpressionTest`
- [x] `JsonJQTransformSpec` → `JsonJQTransformTest`
- [x] `LambdaAndTerminateTaskSpec` → `LambdaAndTerminateTaskTest`
- [x] `NestedForkJoinSubWorkflowSpec` → `NestedForkJoinSubWorkflowTest`
- [x] `RetryPolicySpec` → `RetryPolicyTest`
- [x] `S3ExternalPayloadStorageE2ESpec` → `S3ExternalPayloadStorageE2ETest`
- [x] `SetVariableTaskSpec` → `SetVariableTaskTest`
- [x] `SQSEventQueueE2ESpec` → `SQSEventQueueE2ETest`
- [x] `StartWorkflowSpec` → `StartWorkflowTest`
- [x] `SubWorkflowRerunSpec` → `SubWorkflowRerunTest`
- [x] `SubWorkflowRestartSpec` → `SubWorkflowRestartTest`
- [x] `SubWorkflowRetrySpec` → `SubWorkflowRetryTest`
- [x] `SubWorkflowSpec` → `SubWorkflowTest`
- [x] `SwitchTaskSpec` → `SwitchTaskTest`
- [x] `SystemTaskSpec` → `SystemTaskTest`
- [x] `TaskLimitsWorkflowSpec` → `TaskLimitsWorkflowTest`
- [x] `TestWorkflowSpec` → `TestWorkflowTest`
- [x] `WaitTaskSpec` → `WaitTaskTest`
- [x] `WorkflowAndTaskConfigurationSpec` → `WorkflowAndTaskConfigurationTest`
- [x] `QueueResiliencySpec` → `QueueResiliencyTest` (`@Disabled` — Spock spy interactions not portable)
- [x] `TaskResiliencySpec` → `TaskResiliencyTest` (`@Disabled` — Spock spy interactions not portable)

## Final cleanup

- [x] Remove `apply plugin: 'groovy'` from `test-harness/build.gradle`
- [x] Remove `org.apache.groovy:groovy-all`, `spock-core`, `spock-spring`, `testcontainers:spock` deps
- [x] Remove `test-harness` from root spotless groovy configuration
- Note: `revGroovy`/`revSpock` kept in `dependencies.gradle` — still used by cassandra-persistence, core, kafka, redis-concurrency-limit, etc.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.