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

[RORDEV-1402] Manual job for integration tests in Azure pipelines #1079

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mateuszkp96
Copy link
Collaborator

@mateuszkp96 mateuszkp96 commented Feb 18, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a dedicated integration testing phase in the continuous integration process, activated manually.
    • Added a new parameter to control the execution of integration tests.
    • Enhanced testing capabilities with parallel execution for various integration scenarios, improving system reliability and overall quality.

Copy link

coderabbitai bot commented Feb 18, 2025

📝 Walkthrough

Walkthrough

This change introduces a new pipeline stage called INTEGRATION_TEST in the Azure Pipelines configuration. The stage is set to run only when a build is manually triggered and the parameter runIntegrationTests is set to true. It consists of two jobs that execute in parallel, each running within an openjdk:22-slim container and having a timeout of 120 minutes. Both jobs perform several steps: checking out the code, exporting AWS credentials, executing a script to run the pipeline, and publishing test results when execution fails. Each job leverages a matrix to specify different integration test configurations—one covering versions es816x through es80x and the other covering versions es717x through es67x. A new boolean parameter, runIntegrationTests, has also been added to control the execution of these tests.

Sequence Diagram(s)

sequenceDiagram
    participant User as Manual Trigger
    participant Pipeline as Azure Pipelines
    participant Job1 as Integration Job (es816x-es80x)
    participant Job2 as Integration Job (es717x-es67x)
    
    User->>Pipeline: Initiate Manual Build
    Pipeline->>Job1: Trigger Job in openjdk:22-slim container
    Pipeline->>Job2: Trigger Job in openjdk:22-slim container
    
    Job1->>Job1: Checkout Code
    Job1->>Job1: Export AWS Credentials
    Job1->>Job1: Execute Pipeline Script
    Job1->>Pipeline: Publish Test Results on Failure
    
    Job2->>Job2: Checkout Code
    Job2->>Job2: Export AWS Credentials
    Job2->>Job2: Execute Pipeline Script
    Job2->>Pipeline: Publish Test Results on Failure
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
azure-pipelines.yml (1)

531-590: First Integration Test Job Setup with Matrix (IT_es816x - IT_es80x)

This job is set to run inside the openjdk:22-slim container with a 120‑minute timeout, and its steps (checkout, environment export, script execution, and publishing test results) are structured appropriately. Consider refactoring common steps into a reusable template to DRY up the configuration if similar patterns persist.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52ac3f4 and 7ec1ed4.

📒 Files selected for processing (1)
  • azure-pipelines.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: ror (Run all tests IT_es67x)
  • GitHub Check: ror (Run all tests IT_es80x)
  • GitHub Check: ror (Run all tests IT_es70x)
  • GitHub Check: ror (Run all tests IT_es810x)
  • GitHub Check: ror (Run all tests UNIT)
  • GitHub Check: ror (Run all tests IT_es710x)
  • GitHub Check: ror (Run all tests IT_es816x)
  • GitHub Check: ror (Run all tests LICENSE)
  • GitHub Check: ror (Run all tests IT_es717x)
  • GitHub Check: ror (CVE check Job)
🔇 Additional comments (1)
azure-pipelines.yml (1)

526-530: Stage Configuration for Manual Integration Tests

The new INTEGRATION_TEST stage is clearly configured to run only when the build is manually triggered. Using dependsOn: [ ] ensures it runs independently, which aligns with the PR objective.

Comment on lines +591 to +642
timeoutInMinutes: 120
steps:
- checkout: self
fetchDepth: 1
clean: false
persistCredentials: true
- script: |
# Translate back env vars to avoid cyclical reference :/
export aws_access_key_id=$var_aws_access_key_id
export aws_secret_access_key=$var_aws_secret_access_key

echo "[TEST] executing ROR_TASK = $ROR_TASK"
ci/run-pipeline.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
var_aws_secret_access_key: $(aws_secret_access_key)
- task: PublishTestResults@2
condition: failed()
inputs:
testRunTitle: "$(ROR_TASK) results"
testResultsFiles: "**/TEST*xml"
mergeTestResults: true
strategy:
maxParallel: 99
matrix:
IT_es717x:
ROR_TASK: integration_es717x
IT_es716x:
ROR_TASK: integration_es716x
IT_es714x:
ROR_TASK: integration_es714x
IT_es711x:
ROR_TASK: integration_es711x
IT_es710x:
ROR_TASK: integration_es710x
IT_es79x:
ROR_TASK: integration_es79x
IT_es78x:
ROR_TASK: integration_es78x
IT_es77x:
ROR_TASK: integration_es77x
IT_es74x:
ROR_TASK: integration_es74x
IT_es73x:
ROR_TASK: integration_es73x
IT_es72x:
ROR_TASK: integration_es72x
IT_es70x:
ROR_TASK: integration_es70x
IT_es67x:
ROR_TASK: integration_es67x

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Second Integration Test Job: Missing Container Declaration

While the first job explicitly uses the openjdk:22-slim container, the second job omits it. According to the integration test requirements, both jobs should run within the same container environment. To ensure consistency and avoid potential environment discrepancies, please add the container directive. For example:

-      - job:
-        timeoutInMinutes: 120
+      - job:
+        container: openjdk:22-slim
+        timeoutInMinutes: 120
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
timeoutInMinutes: 120
steps:
- checkout: self
fetchDepth: 1
clean: false
persistCredentials: true
- script: |
# Translate back env vars to avoid cyclical reference :/
export aws_access_key_id=$var_aws_access_key_id
export aws_secret_access_key=$var_aws_secret_access_key
echo "[TEST] executing ROR_TASK = $ROR_TASK"
ci/run-pipeline.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
var_aws_secret_access_key: $(aws_secret_access_key)
- task: PublishTestResults@2
condition: failed()
inputs:
testRunTitle: "$(ROR_TASK) results"
testResultsFiles: "**/TEST*xml"
mergeTestResults: true
strategy:
maxParallel: 99
matrix:
IT_es717x:
ROR_TASK: integration_es717x
IT_es716x:
ROR_TASK: integration_es716x
IT_es714x:
ROR_TASK: integration_es714x
IT_es711x:
ROR_TASK: integration_es711x
IT_es710x:
ROR_TASK: integration_es710x
IT_es79x:
ROR_TASK: integration_es79x
IT_es78x:
ROR_TASK: integration_es78x
IT_es77x:
ROR_TASK: integration_es77x
IT_es74x:
ROR_TASK: integration_es74x
IT_es73x:
ROR_TASK: integration_es73x
IT_es72x:
ROR_TASK: integration_es72x
IT_es70x:
ROR_TASK: integration_es70x
IT_es67x:
ROR_TASK: integration_es67x
- job:
container: openjdk:22-slim
timeoutInMinutes: 120
steps:
- checkout: self
fetchDepth: 1
clean: false
persistCredentials: true
- script: |
# Translate back env vars to avoid cyclical reference :/
export aws_access_key_id=$var_aws_access_key_id
export aws_secret_access_key=$var_aws_secret_access_key
echo "[TEST] executing ROR_TASK = $ROR_TASK"
ci/run-pipeline.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
var_aws_secret_access_key: $(aws_secret_access_key)
- task: PublishTestResults@2
condition: failed()
inputs:
testRunTitle: "$(ROR_TASK) results"
testResultsFiles: "**/TEST*xml"
mergeTestResults: true
strategy:
maxParallel: 99
matrix:
IT_es717x:
ROR_TASK: integration_es717x
IT_es716x:
ROR_TASK: integration_es716x
IT_es714x:
ROR_TASK: integration_es714x
IT_es711x:
ROR_TASK: integration_es711x
IT_es710x:
ROR_TASK: integration_es710x
IT_es79x:
ROR_TASK: integration_es79x
IT_es78x:
ROR_TASK: integration_es78x
IT_es77x:
ROR_TASK: integration_es77x
IT_es74x:
ROR_TASK: integration_es74x
IT_es73x:
ROR_TASK: integration_es73x
IT_es72x:
ROR_TASK: integration_es72x
IT_es70x:
ROR_TASK: integration_es70x
IT_es67x:
ROR_TASK: integration_es67x

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
azure-pipelines.yml (1)

603-654: ⚠️ Potential issue

Second Integration Test Job: Missing Container Declaration
The second job in the INTEGRATION_TEST stage lacks the container declaration, which is required for consistency with the first job. This discrepancy could lead to environment differences between the two jobs. Please add the following to the job configuration:

+        container: openjdk:22-slim
🧹 Nitpick comments (1)
azure-pipelines.yml (1)

34-41: Addition of Integration Tests Parameter
The new boolean parameter runIntegrationTests is configured correctly with a default of false and an explicit values list. Given that booleans naturally take only true or false, consider if the values block is necessary.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ec1ed4 and 6149ad5.

📒 Files selected for processing (1)
  • azure-pipelines.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: ror (Run all tests UNIT)
  • GitHub Check: ror (Run all tests LICENSE)
  • GitHub Check: ror (Run all tests IT_es67x)
  • GitHub Check: ror (Run all tests IT_es80x)
  • GitHub Check: ror (Run all tests IT_es70x)
  • GitHub Check: ror (Run all tests IT_es810x)
  • GitHub Check: ror (Run all tests IT_es710x)
  • GitHub Check: ror (CVE check Job)
  • GitHub Check: ror (Run all tests IT_es717x)
  • GitHub Check: ror (Run all tests IT_es816x)
🔇 Additional comments (3)
azure-pipelines.yml (3)

7-7: New Variable Mapping for Integration Tests
The variable runIntegrationTests is now mapped from the parameter, which is appropriate. Ensure that this mapping is referenced consistently throughout the pipeline configuration.


534-541: New Stage Definition for Integration Tests
The INTEGRATION_TEST stage is properly set up to run only for manual builds when runIntegrationTests is enabled. The condition using both the build reason and the parameter is clear and meets the PR objectives.


543-602: First Integration Test Job: Container Usage and Matrix Configuration
This first job within the INTEGRATION_TEST stage correctly specifies the openjdk:22-slim container, a sensible timeout, and a comprehensive matrix covering the intended ES integration tests.

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