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

Improve Integration Test by Generating TLS/mTLS Certificates via MSBuild #5818

Merged
merged 25 commits into from
Oct 17, 2024

Conversation

sandy2008
Copy link
Contributor

@sandy2008 sandy2008 commented Sep 9, 2024

Fixes #2009
Based on PR #4731

Changes

This PR introduces an improvement in how integration tests handle TLS/mTLS certificates by generating them at build time via MSBuild. The generated certificates are stored in the build output directory.

Key Changes:

  • Added MSBuild tasks to generate certificates/keys during the build process.
  • Certificates are generated via PowerShell on Windows and Bash on Unix.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

License Information

THIS SOFTWARE IS CONTRIBUTED SUBJECT TO THE TERMS OF THE APACHE LICENSE V.2.0. YOU MAY OBTAIN A COPY OF THE LICENSE AT https://github.com/open-telemetry/opentelemetry-python/blob/master/LICENSE.

THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.

@sandy2008 sandy2008 requested a review from a team September 9, 2024 02:44
@github-actions github-actions bot added the pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package label Sep 9, 2024
@sandy2008 sandy2008 mentioned this pull request Sep 9, 2024
4 tasks
@sandy2008 sandy2008 force-pushed the main branch 4 times, most recently from 0a6183e to 4b43f25 Compare September 9, 2024 08:11
Copy link

codecov bot commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.26%. Comparing base (6250307) to head (a3363f3).
Report is 354 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5818      +/-   ##
==========================================
+ Coverage   83.38%   86.26%   +2.88%     
==========================================
  Files         297      257      -40     
  Lines       12531    11252    -1279     
==========================================
- Hits        10449     9707     -742     
+ Misses       2082     1545     -537     
Flag Coverage Δ
unittests ?
unittests-Project-Experimental 85.94% <ø> (?)
unittests-Project-Stable 86.24% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 238 files with indirect coverage changes

@sandy2008
Copy link
Contributor Author

@reyang Hi! Fixed accordingly.

@sandy2008
Copy link
Contributor Author

@reyang Do you know what's the next step to get it merged, so that we can work on the remaining PRs to support mTLS? 🥹

@reyang
Copy link
Member

reyang commented Sep 11, 2024

@reyang Do you know what's the next step to get it merged, so that we can work on the remaining PRs to support mTLS? 🥹

@sandy2008
Copy link
Contributor Author

@reyang @alanwest Please kindly review again!

@alanwest
Copy link
Member

@sandy2008 try running the test locally. The CI does not pass.

@sandy2008
Copy link
Contributor Author

@sandy2008 try running the test locally. The CI does not pass.

Sorry sorry, I forgot to push one change..

@sandy2008
Copy link
Contributor Author

@alanwest Hmm, seems I need to give one fix, will fix it tmr.

@sandy2008
Copy link
Contributor Author

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day.

Hi! I am still on it.

@Kielek Kielek removed the Stale Issues and pull requests which have been flagged for closing due to inactivity label Oct 3, 2024
@sandy2008
Copy link
Contributor Author

sandy2008 commented Oct 8, 2024

@alanwest Hi! Now should be fixed :)

opentelemetry-dotnet-tests-1           | Test Run Successful.
opentelemetry-dotnet-tests-1           | Total tests: 26
opentelemetry-dotnet-tests-1           |      Passed: 26
opentelemetry-dotnet-tests-1           |  Total time: 1.0144 Minutes
opentelemetry-dotnet-tests-1 exited with code 0
Aborting on container exit...
[+] Stopping 3/3
 ✔ Container opentelemetry-dotnet-tests-1           Stopped                0.0s 
 ✔ Container opentelemetry-dotnet-otel-collector-1  Stopped                0.1s 
 ✔ Container opentelemetry-dotnet-init-service-1    Stopped               10.1s

@sandy2008
Copy link
Contributor Author

Please help take a look & trigger the pipeline if you have time! Thank you so much!
@alanwest @CodeBlanch

@sandy2008
Copy link
Contributor Author

@Kielek Thank you for triggering the pipelines :) Is there a way that I can run the pipelines on my GitHub as well?

@Kielek
Copy link
Contributor

Kielek commented Oct 10, 2024

@sandy2008, triggering pipeline by maintainers/approvers is only for first time contributors. All your following PRs will be executed automatically.

@sandy2008
Copy link
Contributor Author

@sandy2008, triggering pipeline by maintainers/approvers is only for first time contributors. All your following PRs will be executed automatically.

Thank you! Would you mind triggering the pipeline again?

@sandy2008
Copy link
Contributor Author

Please help take a look & trigger the pipeline if you have time! Thank you so much!
@alanwest @CodeBlanch

@sandy2008
Copy link
Contributor Author

@alanwest Sorry.. Again please😭 Got a cert permission issue.. Now should be ok..

@alanwest
Copy link
Member

Thanks @sandy2008, looks like the CI is happy now. I will take another look at the PR tomorrow.

@sandy2008
Copy link
Contributor Author

Thank you so much for approving it :) @alanwest Do you know what's the next step to get it merged?

@alanwest alanwest merged commit 0343715 into open-telemetry:main Oct 17, 2024
31 checks passed
@alanwest
Copy link
Member

merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add OTLP Exporter TLS/mTLS configuration options
6 participants