Skip to content

[chore][chef] Run tests against locally built artifact #6333

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 18 commits into
base: main
Choose a base branch
from

Conversation

crobert-1
Copy link
Contributor

@crobert-1 crobert-1 commented Jun 17, 2025

Description:

Same idea as #6284, updating Chef tests to run against locally built artifacts.

  • Introduced a new variable local_artifact_testing_enabled that will install the collector from a local artifact when set to true.
  • Added workflow build functionality is all copied from other workflows. Once [chore][CICD] Reuse more GitHub workflow jobs #6329 is merged we can reuse the reusable workflows.

@crobert-1 crobert-1 force-pushed the chef_test_current_build branch from 577e379 to 75a4c79 Compare June 17, 2025 21:34
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.81%. Comparing base (ae23889) to head (1854120).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6333      +/-   ##
==========================================
+ Coverage   36.83%   44.81%   +7.97%     
==========================================
  Files         381      390       +9     
  Lines       26732    26995     +263     
==========================================
+ Hits         9848    12099    +2251     
+ Misses      15908    14023    -1885     
+ Partials      976      873     -103     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

source "#{node['splunk_otel_collector']['windows_repo_url']}/splunk-otel-collector-#{collector_version}-amd64.msi"
action :create
only_if { !::File.exist?(node['splunk_otel_collector']['collector_version_file']) || (::File.readlines(node['splunk_otel_collector']['collector_version_file']).first.strip != collector_version) }
remote_destination_path = "#{ENV['TEMP']}/splunk-otel-collector-#{collector_version}-amd64.msi"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

collector_version may not actually match the local artifact's version, but for simplicity of the remaining logic I figure there isn't much harm in keeping the name the same for testing.

@crobert-1 crobert-1 force-pushed the chef_test_current_build branch from 5badc9c to ab5a4c5 Compare June 18, 2025 20:15
- name: Extract artifacts
run: |
mkdir -p files
deb_path=$(find /tmp/deb-amd64-package/splunk-otel-collector*amd64.deb)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For all three paths, deb_path, rpm_path, and msiPath, we're relying on the directories to only have a single file that matches the regex. This might fail in the future if built artifacts change names, or end up having more than one matching artifact.

@crobert-1 crobert-1 marked this pull request as ready for review June 18, 2025 22:57
@crobert-1 crobert-1 requested review from a team as code owners June 18, 2025 22:57
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