Skip to content

feat: support multiple test source sets (e.g. integrationTest suite)#49

Merged
jimisola merged 3 commits intomainfrom
feat/multi-test-source-sets-issue-48
Apr 17, 2026
Merged

feat: support multiple test source sets (e.g. integrationTest suite)#49
jimisola merged 3 commits intomainfrom
feat/multi-test-source-sets-issue-48

Conversation

@jimisola
Copy link
Copy Markdown
Member

Summary

Closes #48

  • Changed svcsAnnotationsFile (RegularFileProperty) → svcsAnnotationsFiles (ConfigurableFileCollection) in RequirementsToolExtension and RequirementsToolTask
  • The collection lazily auto-discovers all non-main source sets from the Java plugin and resolves the annotation processor output path for each, so integrationTest (and any other JvmTestSuite) are picked up without any configuration
  • In execute(), all files in the collection are iterated and their tests nodes deep-merged: duplicate SVC keys have their entry arrays concatenated; new keys are added
  • Added mergeTestNodes static helper (package-private, directly testable)
  • Updated test fixture to include an integrationTest JvmTestSuite with HelloIT annotated @SVCs("SVC_002") and added SVC_002 to software_verification_cases.yml; verified that build/reqstool/annotations.yml contains both SVC_001 and SVC_002 after assembleRequirements

Test plan

  • ./gradlew test — all existing tests + new testMergeTestNodes_mergesTwoFiles pass
  • cd tests/fixtures/test_project && gradle assembleRequirementsbuild/reqstool/annotations.yml contains both SVC_001 (from test) and SVC_002 (from integrationTest)
  • Projects with a single test source set continue to work without any configuration change

Change svcsAnnotationsFile (RegularFileProperty) to svcsAnnotationsFiles
(ConfigurableFileCollection) in RequirementsToolExtension and
RequirementsToolTask. The default collection lazily auto-discovers all
non-main source sets from the Java plugin and adds the annotation
processor output path for each, so projects using JvmTestSuite (e.g.
integrationTest) have their @svcs annotations picked up automatically.

In RequirementsToolTask.execute(), iterate all files in the collection
and deep-merge their tests nodes via the new mergeTestNodes helper: for
duplicate SVC keys, entry arrays are concatenated; new keys are added.

Update the test fixture to add an integrationTest JvmTestSuite with
HelloIT annotated @svcs("SVC_002"), and add SVC_002 to
software_verification_cases.yml. After assembleRequirements, both
SVC_001 (from test) and SVC_002 (from integrationTest) appear in the
combined annotations.yml.

Closes #48

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
@jimisola jimisola self-assigned this Apr 17, 2026
@jimisola jimisola merged commit 21ffe7e into main Apr 17, 2026
6 checks passed
@jimisola jimisola deleted the feat/multi-test-source-sets-issue-48 branch April 17, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support multiple test source sets (e.g. Gradle integrationTest suite)

1 participant