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

spread, tests: use prebuilt gojq, add simple tool for fetching files #14738

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

Conversation

bboozzoo
Copy link
Contributor

@bboozzoo bboozzoo commented Nov 19, 2024

It is not viable to build gojq in some of the test environments (eg. beta validation), so use a prebuilt binary from github.

Since we do not always have a wget or curl available on the host, add a simplistic replacement which is only capable of fetching files.

NOTE this doesn't solve the case for armhf yet, we do not have prebuilt binaries available there.

Related: SNAPDENG-34224

Add a trivial script that can be used as a replacement for wget/curl if
we're only interested in fetching a file.

Signed-off-by: Maciej Borzecki <[email protected]>
We need gojq for the tests. Make sure it is avaialble.

Signed-off-by: Maciej Borzecki <[email protected]>
@bboozzoo bboozzoo added the Simple 😃 A small PR which can be reviewed quickly label Nov 19, 2024
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.03%. Comparing base (96ea7b0) to head (f49c0a7).
Report is 80 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14738      +/-   ##
==========================================
+ Coverage   78.95%   79.03%   +0.08%     
==========================================
  Files        1084     1087       +3     
  Lines      146638   147666    +1028     
==========================================
+ Hits       115773   116708     +935     
- Misses      23667    23729      +62     
- Partials     7198     7229      +31     
Flag Coverage Δ
unittests 79.03% <ø> (+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.


🚨 Try these New Features:

@sergiocazzolato
Copy link
Collaborator

tests are passing: https://paste.ubuntu.com/p/MCkYcNJhNc/

@Meulengracht
Copy link
Member

Meulengracht commented Nov 19, 2024

Will this fix the broken CI on core-base as well? (see https://github.com/canonical/core-base/actions/runs/11907759283/job/33182571839?pr=287)

import logging
import datetime
from urllib import request
from urllib.parse import urlparse
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're using urllib, is there a reason why not to use urllib.request.urlretrieve? Then the code would just be:

from urllib import request
request.urlretrieve(opts.URL, opts.output)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use urlretrieve, since it's handling a bit more errors.

@bboozzoo
Copy link
Contributor Author

Will this fix the broken CI on core-base as well? (see https://github.com/canonical/core-base/actions/runs/11907759283/job/33182571839?pr=287)

w8, how did core-base end up using gojq?

@bboozzoo
Copy link
Contributor Author

Looks like older Python has stronger opinion on whether ENOENT when removing NamedTempFile matters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple 😃 A small PR which can be reviewed quickly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants