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: download core and ubuntu-core at most once #3641

Merged
merged 2 commits into from
Aug 4, 2017

Conversation

zyga
Copy link
Collaborator

@zyga zyga commented Aug 2, 2017

This patch relies on snapd's ability to resume partial downloads. In
the one-off preparation phase we download a set of snaps, chop off the
last byte and move them to /var/lib/snapd/snaps adding the .partial
suffix to enable the download beavior. Each test that needs to pull in
one of those two fill then take advantage of the existing file and will
do minimal network traffic required to achieve this.

Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

This patch relies on snapd's ability to resume partial downloads.  In
the one-off preparation phase we download a set of snaps, chop off the
last byte and move them to /var/lib/snapd/snaps adding the .partial
suffix to enable the download beavior. Each test that needs to pull in
one of those two fill then take advantage of the existing file and will
do minimal network traffic required to achieve this.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
@codecov-io
Copy link

codecov-io commented Aug 2, 2017

Codecov Report

Merging #3641 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3641      +/-   ##
==========================================
- Coverage    75.2%   75.16%   -0.04%     
==========================================
  Files         387      388       +1     
  Lines       33452    33628     +176     
==========================================
+ Hits        25159    25278     +119     
- Misses       6481     6534      +53     
- Partials     1812     1816       +4
Impacted Files Coverage Δ
daemon/response.go 81.29% <0%> (-7.82%) ⬇️
client/apps.go 96.61% <0%> (-3.39%) ⬇️
systemd/systemd.go 81.81% <0%> (-3.32%) ⬇️
interfaces/sorting.go 98.71% <0%> (-1.29%) ⬇️
daemon/daemon.go 61.6% <0%> (-1.01%) ⬇️
cmd/snap/cmd_services.go 5.76% <0%> (-0.49%) ⬇️
store/store.go 79.7% <0%> (-0.28%) ⬇️
interfaces/builtin/kvm.go 61.53% <0%> (ø)
daemon/api.go 71.9% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e037060...53eb74b. Read the comment docs.

# There is a bug in snapd where partial file must be a proper
# prefix of the full file or we make a wrong request to the
# store.
truncate --size=$(expr $(stat $snap_file.partial -c %s) - 1) $snap_file.partial
Copy link
Contributor

Choose a reason for hiding this comment

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

truncate --size=-1 would DWYW 😃

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, I didn't know that works. Nice!

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
@zyga
Copy link
Collaborator Author

zyga commented Aug 4, 2017

Merging, I just saw another test failing on "whooping" 100KB/s download speed that ended up with timeout.

@zyga zyga merged commit e210dc8 into snapcore:master Aug 4, 2017
@zyga zyga deleted the rfc/caching-snaps-for-tests branch August 4, 2017 21:45
# There is a bug in snapd where partial file must be a proper
# prefix of the full file or we make a wrong request to the
# store.
truncate --size=-1 $snap_file.partial
Copy link
Contributor

Choose a reason for hiding this comment

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

@zyga did you land a patch to drop this truncate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants