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

DAT-10564 #72

Merged
merged 60 commits into from
Sep 19, 2023
Merged

DAT-10564 #72

merged 60 commits into from
Sep 19, 2023

Conversation

jandroav
Copy link
Contributor

Changes for liquibase-liquibase sonar scan workflow

jandroav added 30 commits September 6, 2023 16:17
…step for MacOS compatibility

refactor(sonar-test-scan.yml): remove installation of sqlplus for integration tests as it is no longer needed
refactor(sonar-test-scan.yml): remove unnecessary environment variable exports and sourcing of bash profile in SonarCloud step
… to ubuntu-22.04 for better compatibility

feat(sonar-test-scan.yml): update mvnd installation process to download and unzip the latest release from the official Apache Maven mvnd repository
feat(sonar-test-scan.yml): add installation steps for sqlplus and instantclient for integration tests
chore(sonar-test-scan.yml): remove unnecessary setup steps for docker and sqlcmd
…ntegration test reports

feat(sonar-test-scan.yml): add support for downloading unit test report artifact

feat(sonar-test-scan.yml): add support for downloading integration test report artifacts for different databases (mssql, mysql, oracle, postgresql)

chore(sonar-test-scan.yml): remove unnecessary step to install mvnd

chore(sonar-test-scan.yml): remove unnecessary step to install sqlplus for integration tests

chore(sonar-test-scan.yml): cache SonarCloud packages to improve build performance

chore(sonar-test-scan.yml): merge integration and unit tests reports before running Sonar Scan
…specify the name of the coverage module

fix(sonar-test-scan.yml): fix the directory change command to use the coverageModuleName input value instead of a hardcoded value
…n and unit tests reports

feat(sonar-test-scan.yml): add separate mvn command to merge jacoco results for better clarity and maintainability
…on v21 for compatibility and potential bug fixes
…e integration and unit tests reports' step
…dd6/action-download-artifact@v2.27.0 to fix compatibility issue

feat(sonar-test-scan.yml): add if_no_artifact_found: warn option to download-artifact actions to prevent failure when no artifact is found
refactor(sonar-test-scan.yml): update download artifact names to use dynamic inputs for integration test reports to improve flexibility and reusability
refactor(sonar-test-scan.yml): update download artifact names to use dynamic inputs for integration test reports to improve flexibility and reusability
…or Maven settings.xml setup

chore(sonar-test-scan.yml): update docker/login-action to v2 for GitHub Container Registry login
chore(sonar-test-scan.yml): update action-download-artifact to v2.27.0 for downloading integration test reports
chore(sonar-test-scan.yml): add installation steps for sqlplus and instantclient for Integration tests
chore(sonar-test-scan.yml): remove merge integration and unit tests reports step
chore(sonar-test-scan.yml): update mvn command to include ORACLE_HOME, PATH, SQLPATH, NLS_LANG, and LD_LIBRARY_PATH environment variables for Oracle integration tests
…on v21 for compatibility and potential bug fixes
…egration-test-results artifact name to simplify naming convention
…artifact name, integration test report artifact name, and coverage module name to improve flexibility and customization

fix(sonar-test-scan.yml): remove unnecessary step to install mvnd
feat(sonar-test-scan.yml): download unit test report artifact and integration test report artifacts for mssql, mysql, oracle, and postgresql databases
feat(sonar-test-scan.yml): merge integration and unit tests reports using jacoco
feat(sonar-test-scan.yml): add step to cache SonarCloud packages for faster subsequent runs
feat(sonar-test-scan.yml): add step to perform Sonar Scan with necessary environment variables and configurations
chore(sonar-test-scan.yml): remove unnecessary step to save test results as artifacts
…en command

The duplicate '-DskipTests' flag in the Maven command was causing an error. Removed the duplicate flag to fix the issue.
…Maven command to avoid redundancy and improve readability
…the latest version of Java for the Sonar test scan workflow
…ts to improve organization and readability
The changes in this commit improve the merging and moving of test reports in the sonar-test-scan.yml workflow file.

- Added commands to list the contents of directories for debugging purposes.
- Created a new directory called "reports" to store the merged test reports.
- Moved the unit test coverage report to the "reports" directory.
- Moved the integration test coverage reports for different databases (mssql, mysql, oracle, postgresql) to the "reports" directory.
- Moved the aggregated coverage reports for different databases to the "reports" directory.
- Updated the commands to use the correct paths for moving the files.
- Added comments to explain the purpose of each command.
…n 3 for unit and integration test reports

chore(sonar-test-scan.yml): remove if_no_artifact_found option from download-artifact action for integration test reports
chore(sonar-test-scan.yml): update download-artifact action for integration test reports to use correct artifact names and paths
chore(sonar-test-scan.yml): remove if_no_artifact_found option from download-artifact action for postgresql integration test report
chore(sonar-test-scan.yml): remove unnecessary whitespace
… before continuing the workflow execution

chore(sonar-test-scan.yml): update comment to disable shallow clones for better analysis relevancy
chore(sonar-test-scan.yml): add step to set up JDK for the workflow execution
…orts

The file paths for the jacoco coverage reports have been updated in the sonar-test-scan.yml workflow file. The following changes were made:

- The unit test coverage report file path has been changed from "unit-tests/liquibase-pro-coverage/target/aggregate.exec" to "unit-tests/liquibase-pro-coverage/target/jacoco.exec" and it has been moved to the "./reports/jacoco-unit.exec" directory.
- The integration test coverage report file paths for mssql and mysql have been updated from "integration-tests/mssql/liquibase-pro-integration-tests/target/jacoco.exec" and "integration-tests/mysql/liquibase-pro-integration-tests/target/jacoco.exec" respectively.
…o the correct directory

feat(sonar-test-scan.yml): add step to save Jacoco mixed results as an artifact for further analysis
…to simplify the workflow

The directory creation step was creating an unnecessary directory in the workflow. This step has been removed to simplify the workflow and improve readability.
… reports to match new directory structure

The file paths for the aggregated coverage reports in the integration tests have been updated to match the new directory structure. The "aggregate.exec" files are now moved to the "target" directory instead of the "reports" directory. This change ensures that the coverage reports are generated in the correct location for each database type (mssql, mysql, oracle, postgresql).
…ts to match the new directory structure

feat(sonar-test-scan.yml): add steps to download jacoco cli, move it to the appropriate directory, and generate coverage report using jacoco cli
…lity and maintainability

fix(sonar-test-scan.yml): move 'mvn package' command before 'mvn jacoco:merge@cli-merge-results' to ensure correct coverage results
feat(sonar-test-scan.yml): add liquibase version parameter to 'mvn package' command for better control over liquibase version used
…coverage files

The file paths for moving jacoco coverage files were simplified to improve readability and maintainability.
jandroav added 29 commits September 13, 2023 12:01
fix(sonar-test-scan.yml): move the 'cd' command before merging jacoco results to the correct directory
… target directory before running jacococli.jar command
…mand to fix jacoco report generation

The file path "./target" was duplicated in the java -jar command, causing the jacoco report generation to fail. This commit removes the redundant file path to fix the issue.
…port command

The path to the classfiles in the jacoco report command was incorrect. It was pointing to "../../pro/target/" instead of "../../pro/target/classes/". This fix corrects the path to ensure that the jacoco report command can find the necessary classfiles for generating the coverage report.
…hange distribution from 'temurin' to 'adopt' for compatibility reasons
…leName and integrationTestsModuleName to improve flexibility

fix(sonar-test-scan.yml): update file paths to use the new inputs for testedClassesModuleName and integrationTestsModuleName
fix(sonar-test-scan.yml): update artifact name for jacoco mixed report to improve clarity
…se Java 17 with Temurin

chore(sonar-test-scan.yml): refactor file moving logic to handle different integration test directories
chore(sonar-test-scan.yml): remove unnecessary -T flag from Maven command
…vn command

The redundant line `mvn -B verify -P 'unit,!run-proguard' -Dliquibase.version=${{ inputs.liquibaseBranchName }}-SNAPSHOT` is removed to avoid duplication and improve code readability.
…o v2.27.0 for all artifact downloads

chore(sonar-test-scan.yml): add 'if_no_artifact_found: warn' option to all artifact downloads to handle missing artifacts gracefully
chore(sonar-test-scan.yml): remove unnecessary whitespace
…nload test reports

The workflow file 'sonar-test-scan.yml' was modified to include the 'workflow' and 'run_id' parameters in the steps that download test reports. This change allows the download step to be associated with the correct workflow run and ensures that the test reports are downloaded from the correct workflow run.
…n 3 for unit and integration tests reports

chore(sonar-test-scan.yml): remove unnecessary if_no_artifact_found option from download-artifact actions
chore(sonar-test-scan.yml): remove unnecessary workflow and run_id options from download-artifact actions
chore(sonar-test-scan.yml): add if: always() condition to download-artifact actions for integration tests reports
chore(sonar-test-scan.yml): add if: always() condition to cache SonarCloud packages action
chore(sonar-test-scan.yml): add if: always() condition to merge integration and unit tests reports step
chore(sonar-test-scan.yml): add if: always() condition to save Jacoco Mixed Results step
chore(sonar-test-scan.yml): add if: always() condition to Sonar Scan step
…orkflow

chore(sonar-test-scan.yml): remove unused step to wait for test reports in the workflow
…ven commands to use 'mvn' command instead of './mvnd/bin/mvnd'

The installation of mvnd has been removed as it is no longer needed. The Maven commands have been updated to use the 'mvn' command instead of './mvnd/bin/mvnd' for consistency and to align with standard Maven usage.
…input variable

refactor(sonar-test-scan.yml): simplify file path for moving jacoco.exec files in integration tests
… ensure the project is built before running SonarQube analysis
…or Jacoco mixed results

chore(sonar-test-scan.yml): rename sonar-push job to sonar-scan for better clarity and consistency
…with SonarQube API changes and improve security

The SonarQube API has changed and now requires the use of the `sonar.token` parameter instead of `sonar.login` for authentication. This change ensures that the correct parameter is used and improves the security of the SonarQube integration.
…usions to exclude test files and pom.xml from coverage analysis
…riable

chore(sonar-test-scan.yml): update paths for merging and moving coverage reports to match new project structure
chore(sonar-test-scan.yml): update paths for jacococli.jar and classfiles in jacoco:merge step to match new project structure
…2, hsqldb, and mariadb integration tests to the appropriate directories

The changes were made to the sonar-test-scan.yml workflow file. The following changes were made:

- Added a step to download the h2 integration tests report artifact and move the jacoco.exec file to the integration-tests/h2 directory.
- Added a step to download the hsqldb integration tests report artifact and move the jacoco.exec file to the integration-tests/hsqldb directory.
- Added a step to download the mariadb integration tests report artifact and move the jacoco.exec file to the integration-tests/mariadb directory.

These changes were made to ensure that the jacoco.exec files for the h2, hsqldb, and mariadb integration tests are available in the correct directories for further processing.
…g sqlite integration test reports

chore(sonar-test-scan.yml): move jacoco.exec file from sqlite integration test report to liquibase-coverage target directory
… tests report artifact

chore(sonar-test-scan.yml): move firebird jacoco.exec file to target directory for coverage analysis
…r improved functionality

chore(extension-attach-artifact-release.yml): update script file versions to v0.4.3 for improved functionality
chore(extension-release-published.yml): update extension-release-prepare.yml version to v0.4.3 for improved functionality
chore(os-extension-test.yml): update sonar-pull-request.yml version to v0.4.3 for improved functionality
chore(package-deb.yml): update file versions to v0.4.3 for improved functionality
chore(pom-release-published.yml): update extension-release-prepare.yml version to v0.4.3 for improved functionality
chore(pro-extension-test.yml): update sonar-pull-request.yml version to v0.4.3 for improved functionality
@jandroav jandroav merged commit a1e8087 into main Sep 19, 2023
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.

1 participant