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

Created Integration Tests for SPM #5608 #5636

Closed

Conversation

kunal-511
Copy link

@kunal-511 kunal-511 commented Jun 16, 2024

My First PR.

Which problem is this PR solving?

Description of the changes

  • It introduces basic smoke test to validate the 'docker-compose/monitor/docker-compose.yml' file during the CI process. It adds steps to exisiting github actions workflow to start the service defined in the docker compose file and then shutdown the service

How was this change tested?

  • make test

Checklist

@kunal-511 kunal-511 requested a review from a team as a code owner June 16, 2024 06:08
Signed-off-by: kunal Dugar <yoyokvunal@gmail.com>
run: sudo curl -L "https://github.com/docker/compose/releases/download/v2.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose

- name: Start Docker Compose services
run: docker-compose -f docker-compose/monitor/docker-compose.yml up -d
Copy link
Member

Choose a reason for hiding this comment

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

we don't write integration tests like that. There has to be a way to run integration test locally, for debugging. In your approach you can only run it via GitHub workflow, which prevents debugging. The workflow should just run a script.

- name: v2
binary: jaeger
skip_sampling: true
- name: v1
Copy link
Member

Choose a reason for hiding this comment

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

please undo all whitespace changes, they are not required for your PR

QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}

- name: Set up Docker Compose
run: sudo curl -L "https://github.com/docker/compose/releases/download/v2.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose
Copy link
Member

Choose a reason for hiding this comment

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

docker compose is already available, we don't install it

# Check if Prometheus is accessible
curl -f http://localhost:9090 || exit 1
# Check if Grafana is accessible
curl -f http://localhost:3000 || exit 1
Copy link
Member

Choose a reason for hiding this comment

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

The objective of e2e test is to verify that Jaeger components are fulfilling the expected function. In case of SPM, we can query the internal API that returns the time series results to the UI and validate that there are data points in those results.

- name: Run smoke tests
run: |
# Wait for services to be up
sleep 30
Copy link
Member

Choose a reason for hiding this comment

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

we never do it like this - it introduces a fixed delay to the CI that is almost never needed. Instead we query the service in a loop with a small sleep between iterations, this way as soon as the service is available we exit the loop. You can see example of this in wait_for_storage in scripts/es-integration-test.sh

@yurishkuro yurishkuro mentioned this pull request Jun 16, 2024
4 tasks
@kunal-511
Copy link
Author

@yurishkuro I have added another commit with all issues being addressed. Please have a look

…tions included, removed the docker compose, removed fixed delay.

Signed-off-by: kunal Dugar <yoyokvunal@gmail.com>
Copy link
Member

@FlamingSaint FlamingSaint left a comment

Choose a reason for hiding this comment

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

@kunal-511 are you sure you have pushed the right changes ? I don't see the workflow running a script. Also please remove the extra white space. Please address all the comments on the PR.

Signed-off-by: kunal Dugar <yoyokvunal@gmail.com>
Signed-off-by: kunal Dugar <yoyokvunal@gmail.com>
@yurishkuro
Copy link
Member

solved in #5640

@yurishkuro yurishkuro closed this Jun 29, 2024
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.

3 participants