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

usage: use runtime scope when running maven usage profile #10331

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

sudo87
Copy link
Contributor

@sudo87 sudo87 commented Feb 6, 2025

Fixes error running usage server with maven.

Description

This PR fixes running usage server with maven:

mvn -P usage -Drun -Dpid=$$ -pl usage

Above command fails to bring up usage server and errors out as shown in following screenshot
Screenshot from 2025-02-06 11-10-17

Failure is related to JDBC driver not being available
48.405 [com.cloud.usage.UsageServer.main()] ERROR com.cloud.utils.db.DriverLoader - Failed to load DB driver com.mysql.cj.jdbc.Driver

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Re-run the usage server with mvn and it executes without any issue.

How did you try to break this feature and the system with this change?

Fixes error running usage server with maven.

Signed-off-by: Abhishek Kumar <[email protected]>
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.23%. Comparing base (986ec81) to head (b615fdc).
Report is 34 commits behind head on 4.20.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #10331      +/-   ##
============================================
+ Coverage     16.00%   16.23%   +0.23%     
- Complexity    13065    13507     +442     
============================================
  Files          5644     5671      +27     
  Lines        494870   508387   +13517     
  Branches      59949    64260    +4311     
============================================
+ Hits          79195    82539    +3344     
- Misses       406838   416770    +9932     
- Partials       8837     9078     +241     
Flag Coverage Δ
uitests 4.04% <ø> (+0.02%) ⬆️
unittests 17.08% <ø> (+0.24%) ⬆️

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

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

@sudo87 sudo87 changed the base branch from main to 4.20 February 7, 2025 04:15
@shwstppr shwstppr closed this Feb 7, 2025
@shwstppr shwstppr reopened this Feb 7, 2025
Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm, I don't think smoke test suite will help testing this so needs a manual verification.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12374

@Pearl1594
Copy link
Contributor

I wonder how it worked all this while..

@DaanHoogland
Copy link
Contributor

tested locally

# mvn clean install -P developer,systemvm -Dnoredist -Dsimulator
# mvn -Pdeveloper -pl developer -Ddeploydb
# mvn -Pdeveloper -pl developer -Ddeploydb-simulator
# mvn -pl client jetty:run -Dsimulator
# mvn -P usage -Drun -Dpid=$$ -pl usage

it works.

@DaanHoogland
Copy link
Contributor

DaanHoogland commented Feb 15, 2025

I wonder how it worked all this while..

@Pearl1594 , the usage server is not usually tested in a simulator/maven run. It is normally, even for testing, installed as a regular process.

i.e. it never did

@Pearl1594 Pearl1594 merged commit c121d5b into apache:4.20 Feb 18, 2025
46 of 48 checks passed
@Pearl1594 Pearl1594 deleted the fix-usage-mvn branch February 18, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants