Skip to content

BE-704 | Fix e2e tests #636

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

Open
wants to merge 4 commits into
base: v28.x
Choose a base branch
from
Open

BE-704 | Fix e2e tests #636

wants to merge 4 commits into from

Conversation

deividaspetraitis
Copy link
Member

@deividaspetraitis deividaspetraitis commented Apr 2, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a dedicated integration environment to streamline testing and ensure improved service reliability.
  • Tests

    • Updated external data endpoints for token pricing, ensuring more direct and consistent information.
    • Enhanced messaging service configuration to support more robust authentication during testing.
    • Added new service and input mappings for the integrators environment.

Copy link
Contributor

coderabbitai bot commented Apr 2, 2025

Walkthrough

This pull request updates configuration and constants for integration testing. The workflow dispatch for integration tests now defaults to and supports an “integrators” environment instead of “stage.” Additionally, the Coingecko API URL is updated to a new endpoint. New service mappings for the integrators environment are introduced in the test configuration and SQS service files, including the addition of a constant for the integrators endpoint and an API token header in SQS requests.

Changes

File(s) Change Summary
.github/…/integration-test.yml Modified workflow dispatch inputs: added "integrators" option, changed default value from "stage" to "integrators", and updated the scheduled test job’s environment matrix.
tests/coingecko_service.py Updated COINGECKO_URL from "https://prices.osmosis.zone/api/v3/simple/price" to "https://api.coingecko.com/api/v3/simple/price".
tests/conftest.py, tests/sqs_service.py Added new integrators configuration: in conftest.py, introduced SERVICE_SQS_INTEGRATORS and mapped INEGRATORS_INPUT_NAME to SQS_INTEGRATORS; in sqs_service.py, defined SQS_INTEGRATORS and added an x-api-token header in the SQSService initializer.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHubActions as GitHub Actions
    participant IntegrationJob as Integration Test Job
    participant SQS as SQSService

    Developer->>GitHubActions: Trigger workflow_dispatch (env: integrators)
    GitHubActions->>IntegrationJob: Run scheduled integration test (env: integrators)
    IntegrationJob->>SQS: Initialize SQSService with API key
    SQS-->>IntegrationJob: Return response (with "x-api-token" header)
Loading

Poem

I’m a bunny on the run,
Hopping through changes made under the sun.
"Integrators" now lead the play,
With tokens and tests paving the way.
In code fields, my heart does delight! 🐇

Easter eggs in Spring’s code cheer!


🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

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
Contributor

@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

🧹 Nitpick comments (2)
tests/conftest.py (2)

56-56: Fix typo in constant name.

There's a typo in the constant name INEGRATORS_INPUT_NAME - it should be INTEGRATORS_INPUT_NAME (missing the 'T').

-INEGRATORS_INPUT_NAME = "integrators"
+INTEGRATORS_INPUT_NAME = "integrators"

64-64: Update variable reference after fixing typo.

Update the reference in the INPUT_MAP to use the corrected constant name.

-    INEGRATORS_INPUT_NAME: SQS_INTEGRATORS,
+    INTEGRATORS_INPUT_NAME: SQS_INTEGRATORS,
🧰 Tools
🪛 Ruff (0.8.2)

64-64: SQS_INTEGRATORS may be undefined, or defined from star imports

(F405)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b09162e and 2504829.

📒 Files selected for processing (4)
  • .github/workflows/integration-test.yml (2 hunks)
  • tests/coingecko_service.py (2 hunks)
  • tests/conftest.py (2 hunks)
  • tests/sqs_service.py (2 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
tests/conftest.py

49-49: SQSService may be undefined, or defined from star imports

(F405)


49-49: SQS_INTEGRATORS may be undefined, or defined from star imports

(F405)


50-50: SQSService may be undefined, or defined from star imports

(F405)


50-50: SQS_LOCAL may be undefined, or defined from star imports

(F405)


51-51: CoingeckoService may be undefined, or defined from star imports

(F405)


62-62: SQS_STAGE may be undefined, or defined from star imports

(F405)


63-63: SQS_PROD may be undefined, or defined from star imports

(F405)


64-64: SQS_INTEGRATORS may be undefined, or defined from star imports

(F405)


97-97: SQS_INTEGRATORS may be undefined, or defined from star imports

(F405)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: Summary
🔇 Additional comments (7)
tests/coingecko_service.py (1)

4-4: Good API endpoint update.

Updating the Coingecko API URL from the Osmosis-specific endpoint to the official Coingecko API endpoint. This should help fix the e2e tests as mentioned in the PR objectives.

tests/sqs_service.py (2)

5-5: Good addition of integrators environment endpoint.

Adding the new SQS_INTEGRATORS constant for the integrators environment, which aligns with the PR objectives of fixing e2e tests.


35-35:

❓ Verification inconclusive

Verify if both API headers are required.

The code now sends both x-api-key and x-api-token headers with the same value. Is this redundancy intentional and required by the integrators environment?


🏁 Script executed:

#!/bin/bash
# Check if both headers are used in the codebase
echo "Checking for x-api-token usage in the codebase"
rg -A 3 -B 3 "x-api-token" --type py

Length of output: 458


Header Redundancy: Confirm Intentional Dual Headers

The grep output confirms that both the x-api-key and x-api-token headers are set with the same value in tests/sqs_service.py. Please verify with the integrators whether this redundancy is intentional—perhaps to support backward compatibility or meet specific requirements—and update the implementation if one header is unnecessary.

tests/conftest.py (2)

49-49: Good addition of integrators service.

Adding the SQS service for the integrators environment, which aligns with the changes in other files.

🧰 Tools
🪛 Ruff (0.8.2)

49-49: SQSService may be undefined, or defined from star imports

(F405)


49-49: SQS_INTEGRATORS may be undefined, or defined from star imports

(F405)


97-97: Good service mapping addition.

Adding the service mapping for the integrators environment in the SERVICE_MAP dictionary.

🧰 Tools
🪛 Ruff (0.8.2)

97-97: SQS_INTEGRATORS may be undefined, or defined from star imports

(F405)

.github/workflows/integration-test.yml (2)

12-14: Good environment configuration update.

Adding the integrators environment option and making it the default for the workflow dispatch is consistent with the other changes in this PR. This should help fix the e2e tests as mentioned in the PR objectives.


54-54: Good scheduled test environment update.

Updating the scheduled test to use the integrators environment is consistent with the other changes in this PR.

Copy link
Contributor

@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

🧹 Nitpick comments (3)
.github/workflows/integration-test.yml (3)

11-14: Environment Options and Default Value Updated.
The update correctly adds integrators as one of the environment options and sets it as the default value. However, note that the prod option still appears in the list—please confirm that allowing selection of "prod" is intentional for these tests, as it might lead to unintended behavior if chosen.


47-48: Trailing Whitespace and Comment Clarity.
Static analysis flagged trailing spaces on line 48. Please remove any extra whitespace to avoid YAML lint errors. Additionally, the commented-out COINGECKO_API_KEY line appears in this block; if it’s no longer needed or is superseded by other configuration, consider removing it for clarity.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 48-48: trailing spaces

(trailing-spaces)


75-76: Redundant Commented API Key in Scheduled Job.
Similar to the manual test job, the scheduled job includes a commented-out COINGECKO_API_KEY line. Please verify if leaving these commented-out lines is deliberate; if they no longer serve a purpose, removing them can help maintain a cleaner workflow file.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2504829 and b043fe4.

📒 Files selected for processing (1)
  • .github/workflows/integration-test.yml (3 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/integration-test.yml

[error] 48-48: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary
🔇 Additional comments (1)
.github/workflows/integration-test.yml (1)

53-54: Matrix Environment Configuration Update.
The matrix configuration for the scheduled_integration_test job now uses [integrators], aligning with the updated default environment. This change looks correct and ensures consistency across the workflow.

Copy link

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