Repository navigation
ci: capture pytest exit codes and build test-status.json per label #536
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
CagriYonca
wants to merge
1
commit into
master
Choose a base branch
from
currency-update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| if [[ -z "${CIRCLE_TOKEN:-}" ]]; then | ||
| echo "WARNING: CIRCLE_TOKEN is not set. Skipping waiting for sibling workflows." | ||
| exit 0 | ||
| fi | ||
|
|
||
| PROJECT_SLUG='https://circleci.com/api/v2/project/gh/instana/ruby-sensor' | ||
| PIPELINE_SLUG='https://circleci.com/api/v2/pipeline' | ||
| WORKFLOW_SLUG='https://circleci.com/api/v2/workflow' | ||
|
|
||
| echo "=== Getting Pipeline ID for build #${CIRCLE_BUILD_NUM} ===" | ||
| PIPELINE_ID=$(curl -s \ | ||
| -H "Circle-Token: ${CIRCLE_TOKEN}" \ | ||
| "${PROJECT_SLUG}/job/${CIRCLE_BUILD_NUM}" \ | ||
| | jq -rj '.pipeline.id // empty') | ||
|
|
||
| if [[ -z "${PIPELINE_ID}" ]]; then | ||
| echo "WARNING: Could not retrieve PIPELINE_ID from job info. Proceeding." | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "Pipeline ID: ${PIPELINE_ID}" | ||
|
|
||
| echo "=== Querying workflows for pipeline ===" | ||
| WORKFLOW_INFO=$(curl -sf \ | ||
| -H "Circle-Token: ${CIRCLE_TOKEN}" \ | ||
| "${PIPELINE_SLUG}/${PIPELINE_ID}/workflow" \ | ||
| | jq -r '.items[] | select(.name != "core" and .name != "report_coverage" and .name != "publish") | "\(.id)\t\(.name)"') | ||
|
|
||
| echo "Discovered test workflows to wait for:" | ||
| echo "${WORKFLOW_INFO}" | ||
| echo "" | ||
|
|
||
| # Loop and wait until every sibling workflow reaches a terminal state | ||
| while IFS=$'\t' read -r workflow_id workflow_name; do | ||
| [[ -z "${workflow_id}" ]] && continue | ||
|
|
||
| echo "Waiting for workflow '${workflow_name}' (${workflow_id}) to complete..." | ||
| MAX_ATTEMPTS=120 # up to 30 mins (120 * 15s) | ||
| ATTEMPT=0 | ||
| while [[ ${ATTEMPT} -lt ${MAX_ATTEMPTS} ]]; do | ||
| STATUS=$(curl -s \ | ||
| -H "Circle-Token: ${CIRCLE_TOKEN}" \ | ||
| "${WORKFLOW_SLUG}/${workflow_id}" \ | ||
| | jq -r '.status // "unknown"') | ||
|
|
||
| if [[ "${STATUS}" != "running" && "${STATUS}" != "on_hold" && "${STATUS}" != "unknown" ]]; then | ||
| echo " ✓ Workflow '${workflow_name}' finished with status: ${STATUS}" | ||
| break | ||
| fi | ||
|
|
||
| echo " ... '${workflow_name}' is currently: ${STATUS} (waiting 15s, attempt $((ATTEMPT+1))/${MAX_ATTEMPTS})" | ||
| sleep 15 | ||
| ATTEMPT=$((ATTEMPT + 1)) | ||
| done | ||
| done <<< "${WORKFLOW_INFO}" | ||
|
|
||
| echo "" | ||
| echo "=== All sibling test workflows have finished (including auto-retries) ===" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason to change the
ruby_versionhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grpc installation was failing in Ruby 4.0
It works after switching to Ruby 3.4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use some what like this
ruby-sensor/.circleci/config.yml
Line 429 in 86777de
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
libraries_ruby_34_40, excludinggrpcfor Ruby 4.0 still allows it to run on other Ruby versions because it's a matrix job.However,
update-currency-versionsruns in a single environment to generate version artifacts for all 18 gems. If we run it on Ruby 4.0 and skipgrpc,installed_grpc.txtwon't be generated andgrpcwill be missing from the currency report entirely.Since Ruby 3.4 is the latest stable release, running this job on 3.4 allows all 18 gems (including
grpc) to be installed, tested, and tracked for currency without skipping anything.