Skip to content

task(Enable OS Test) Refs:#35131#35133

Draft
fabrizzio-dotCMS wants to merge 7 commits intomainfrom
issue-35131-OS-Migration-Tests
Draft

task(Enable OS Test) Refs:#35131#35133
fabrizzio-dotCMS wants to merge 7 commits intomainfrom
issue-35131-OS-Migration-Tests

Conversation

@fabrizzio-dotCMS
Copy link
Copy Markdown
Member

@fabrizzio-dotCMS fabrizzio-dotCMS commented Mar 26, 2026

Summary

Registers OpenSearchUpgradeSuite as a dedicated CI test matrix entry so it runs automatically with the OpenSearch 3.x upgrade container activated. Also includes minor code-quality cleanup in ESContentletAPIImpl. This is the CI companion to #35130, which contains the actual test suite implementation.

Changes

CI — .github/test-matrix.yml

  • Added Integration Tests - OpenSearch Upgrade Suite suite entry under integration
  • Overrides base_maven_args with -Dopensearch.upgrade.test=true, which activates the opensearch-upgrade Maven profile — that profile starts the OpenSearch 3.x Docker container on port 9201 and restricts Failsafe to run only OpenSearchUpgradeSuite
  • Fixed a trailing whitespace in the existing base_maven_args block

Backend — ESContentletAPIImpl

  • categories.size() < 1categories.isEmpty()
  • StringBufferStringBuilder (non-synchronized context)
  • String concatenation inside loop → StringBuilder.append() chain

Testing

The suite itself (OpenSearchUpgradeSuite.java and its member tests) lives in the companion PR #35130 and must be merged before this CI entry is exercisable end-to-end.

To verify the matrix entry locally:

# Requires the opensearch-upgrade profile in dotcms-integration/pom.xml
./mvnw verify -pl :dotcms-integration \
  -Dcoreit.test.skip=false \
  -Dopensearch.upgrade.test=true

The profile starts an OpenSearch 3.x container on port 9201 and limits Failsafe to OpenSearchUpgradeSuite.

Breaking Changes

None.

This PR fixes: #35131

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 26, 2026

Claude finished @fabrizzio-dotCMS's task in 2m 32s —— View job


Code Review

.github/test-matrix.yml

Critical fix (correct): Removing -Dopensearch.upgrade.test=true from the shared base_maven_args block (line 63) was necessary. Previously that flag was inherited by all integration suites, which would activate the opensearch-upgrade Maven profile (see dotcms-integration/pom.xml:628) and restrict Failsafe to only include OpenSearchUpgradeSuite.java — silently breaking MainSuite1a through Junit5Suite1.

Potential issue — needs_docker not overridden:
The new suite inherits needs_docker: false from the integration defaults. The opensearch-upgrade Maven profile starts additional Docker containers (database,opensearch,opensearch-upgrade per pom.xml:610). All other integration suites also run with needs_docker: false (they rely on Maven's docker-maven-plugin for test containers), so this is consistent with existing behaviour. However, if the opensearch-upgrade container requires the Docker daemon in a way that differs from standard integration tests, this may silently fail. Worth a smoke-run to confirm the suite actually boots the container on CI.

base_maven_args resolution: Confirmed via cicd_comp_test-phase.yml:144-146 — the workflow appends -Dit.test=OpenSearchUpgradeSuite to the suite's base_maven_args, so the final command is:

verify -Dit.test.forkcount=1 -pl :dotcms-integration -Dcoreit.test.skip=false -Dopensearch.upgrade.test=true -Dit.test=OpenSearchUpgradeSuite

The Maven profile's own <include>**/OpenSearchUpgradeSuite.java</include> and the -Dit.test flag are redundant but consistent. No issue.


ESContentletAPIImpl.java

The four changes (isEmpty(), StringBuilder, chained append()) are correct and uncontroversial micro-improvements. They have no functional relation to issue #35131 (OS Migration Tests) and should not be in this PR. They make the diff harder to read and conflate concerns.


Summary: The test-matrix restructuring is the right approach. The unrelated Java cleanup should be split into a separate commit or PR. Verify the OpenSearch Upgrade Suite successfully starts all required containers in CI before merging.

@github-actions github-actions bot added the Area : CI/CD PR changes GitHub Actions/workflows label Mar 26, 2026
@github-actions github-actions bot added the Area : Backend PR changes Java/Maven backend code label Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Backend PR changes Java/Maven backend code Area : CI/CD PR changes GitHub Actions/workflows

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[TASK] Enable OpenSearch Migration tests in Pipeline

1 participant