Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

22706 cli testscontainers and test reporting improvements #25885

Merged

Conversation

dcolina
Copy link
Contributor

@dcolina dcolina commented Aug 24, 2023

Proposed Changes

  • Add a new testcontainers property to enable or disable this functionality
  • Fixing some CLI integration tests.

Fixes #22706

🤖 Generated by Copilot at 4589d26

This pull request introduces several changes related to the integration testing of the api-data-model and cli modules of the dotCMS CLI tool. It enables and configures the Testcontainers library for both modules, renames some test and helper classes to improve consistency and clarity, modifies the Maven build and the GitHub workflow to handle test failures and generate the Allure test report, and removes some unused imports from the test classes.

🤖 Generated by Copilot at 4589d26

  • Added the testcontainers.enabled property to the application.properties files of the api-data-model and cli modules, with a default value of true, to enable the Testcontainers usage by default for integration testing (link, link)
  • Modified the testcontainers.dotcms.license.file property to include a default value of /path/to/license/file.dat in the application.properties files of the api-data-model and cli modules, to make the Testcontainers configuration more clear and avoid errors when the property is not set (link, link)
  • Added the TESTCONTAINERS_ENABLED constant to the ContainerResource classes of the api-data-model and cli modules, to make the Testcontainers usage configurable and optional by reading the testcontainers.enabled property (link, link)
  • Modified the startContainers and stopContainers methods of the ContainerResource classes of the api-data-model and cli modules, to check the value of the TESTCONTAINERS_ENABLED constant before starting or stopping the Docker containers, and to skip the Testcontainers startup or shutdown when the constant is false (link, link, link, link)
  • Changed the <test.failure.ignore> property from true to false in the pom.xml files of the api-data-model and cli modules, to make the Maven build fail fast and report the test failures as soon as possible (link, link)
  • Modified the ./mvnw clean verify command in the .github/workflows/cli-cicd-test.yml file, to add the -Dtest.failure.ignore=true option, to allow the Maven build to continue even if some tests fail and to enable the generation of the Allure test report (link)
  • Added the .allure directories to the .gitignore file of the tools/dotcms-cli module, to prevent these directories from being tracked by Git and avoid unnecessary files in the repository (link)
  • Renamed the FilesTestHelper class to FilesHelperIntegrationTest in the cli module, to make the name of the helper class more consistent and descriptive for integration testing purposes (link, link, link, link, link, link, link, link)
  • Renamed the RemoteTraversalServiceTest class to RemoteTraversalServiceIntegrationTest in the cli module, to make the name of the test class more consistent and descriptive for integration testing purposes (link, link)
  • Renamed the FilesPullCommandTest class to FilesPullCommandIntegrationTest in the cli module, to make the name of the test class more consistent and descriptive for integration testing purposes (link)
  • Removed the unused imports of the Test and Logger classes from the ContainerTest classes of the api-data-model and cli modules, to clean up the code and follow the best practices of Java coding (link, link)

@dcolina dcolina marked this pull request as ready for review August 28, 2023 16:24
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need these artifacts commented? shouldn't we just remove them?

@nollymar nollymar merged commit 90abbe0 into master Aug 29, 2023
@nollymar nollymar deleted the 22706-cli-testscontainers-and-test-reporting-improvements branch August 29, 2023 00:23
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.

Implement GHA to run CLI tests
4 participants