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

tests, simpleget: replace use of test-snapd-curl with simpleget where possible, support request headers #14884

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bboozzoo
Copy link
Contributor

@bboozzoo bboozzoo commented Dec 19, 2024

Add support for setting request headers to simpleget and replace uses of test-snapd-curl with simpleget in an attempt to reduce the number of external dependencies installed by the tests.

Related: SNAPDENG-34225

Thanks for helping us make a better snapd!
Have you signed the license agreement and read the contribution guide?

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.29%. Comparing base (24a0034) to head (deb25c7).
Report is 72 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14884      +/-   ##
==========================================
+ Coverage   78.20%   78.29%   +0.08%     
==========================================
  Files        1151     1154       +3     
  Lines      151396   152620    +1224     
==========================================
+ Hits       118402   119491    +1089     
- Misses      25662    25758      +96     
- Partials     7332     7371      +39     
Flag Coverage Δ
unittests 78.29% <ø> (+0.08%) ⬆️

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.

Copy link
Contributor

@maykathm maykathm left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link
Contributor

@zyga zyga left a comment

Choose a reason for hiding this comment

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

LGTM with one suggestion on the python side.

if opts.header:
for hdr in opts.header:
sp = hdr.split(": ")
if len(sp) != 2:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would use str.partition https://docs.python.org/3/library/stdtypes.html#str.partition which is somewhat like strings.Cut in Go

Add support for setting request headers using curl-like syntax.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Replace uses of test-snapd-curl with simpleget in an attempt to reduce
the number of external dependencies installed by the tests.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
@bboozzoo bboozzoo force-pushed the bboozzoo/use-simpleget branch from 7f15512 to deb25c7 Compare December 19, 2024 13:12
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