Cucumber glue-path resolution discrepancy in packaged JAR artifacts
0 reputation · 19 Jun 2024, 06:16 UTC
Cucumber test suites execute successfully in a local environment but fail with 'undefined steps' when run within a production CI pipeline. While the local environment correctly identifies step definitions from the src/test/java directory, the production environment fails to locate these classes after they are packaged into a JAR.
The issue appears linked to how Cucumber JVM 7.x handles the glue path when scanning for classes with @CucumberContextConfiguration. If the step definitions are nested within a specific package structure or the working directory in the container differs from the local IDE, the runner may fail to map the feature files to the corresponding code.
How does Cucumber resolve glue-path patterns differently when the step definitions are located inside a compressed JAR versus a flat file system? Are there specific configuration properties required to ensure the scanner traverses the classpath across different working directories in Docker-based production environments?