CircleCI-Public/maven-orb

Nested multi module maven projects can not run `maven/test_parallel`

Closed this issue · 1 comments

Orb Version
1.4.1

Describe the bug
I'm working on a maven project that is split into multiple maven modules, i.e., there are multiple nested maven projects. When using the orb, I try to run the maven/parallel_test command to run tests on multiple nodes for all nested projects. To get all the necessary test files, I need to specify a test_directory param using a ./**/src/test/java glob. This fails, as the glob when being passed to the sed command as it is not a valid regex.

To Reproduce

  1. Create nested multi module maven project
  2. configure circleci pipeline with maven/parallel_test and specify ./**/src/test/java as test_directory param
  3. fails with sed: -e expression #1, char 43: Invalid preceding regular expression

Expected behavior
parallel tests should be able to work with nested multi module maven projects.

I would suggest to change the sed command to either contain a static value, e.g., sed "s#.*src/test/java/\(.*\)\..*#\1#g" or not use the circleci test glob command but something like find instead (I was successful with find . -type f \( -regex ".*src/test/.*/Test.*\..*" -o -regex ".*src/test/.*/.*Test\..*" -o -regex ".*src/test/.*/.*Tests\..*" -o -regex ".*src/test/.*/.*TestCase\..*" \) -print. One could also think about adding the ** glob to the test_directory parameter as a default when resolving the glob.

Additional context
N/A

Hi @aleksdikanski I'm looking into this issue right now