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: Include the tools from snapd-testing-tools project in "$TESTSTOOLS" #10825

Merged

Conversation

sergiocazzolato
Copy link
Collaborator

A new submodule is included in "$TESTSLIB"/external, the idea is to have
a single directory for tools, so all the tools are copied to the
$TESTSTOOLS directory

Initially are not deleted the tools, this will happen in a following
change

A new submodule is included in "$TESTSLIB"/external, the idea is to have
a single directory for tools, so all the tools are copied to the
$TESTSTOOLS directory

Initially are not deleted the tools, this will happen in a following
change
@codecov-commenter
Copy link

codecov-commenter commented Sep 22, 2021

Codecov Report

Merging #10825 (ca8b204) into master (6f5a4ac) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10825   +/-   ##
=======================================
  Coverage   78.19%   78.20%           
=======================================
  Files         914      914           
  Lines      103549   103549           
=======================================
+ Hits        80968    80976    +8     
+ Misses      17498    17493    -5     
+ Partials     5083     5080    -3     
Flag Coverage Δ
unittests 78.20% <ø> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
store/cache.go 69.23% <0.00%> (-1.93%) ⬇️
cmd/snap/cmd_debug_state.go 70.18% <0.00%> (-0.46%) ⬇️
overlord/hookstate/hookmgr.go 75.32% <0.00%> (+0.64%) ⬆️
daemon/api_connections.go 93.58% <0.00%> (+1.06%) ⬆️
sandbox/cgroup/tracking.go 93.98% <0.00%> (+1.26%) ⬆️
osutil/synctree.go 79.24% <0.00%> (+2.83%) ⬆️

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 6f5a4ac...ca8b204. Read the comment docs.

Copy link
Member

@anonymouse64 anonymouse64 left a comment

Choose a reason for hiding this comment

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

Are there other alternatives to using a git submodule? Do we know how well other environments like the autopkgtest and whatever the Fedora equivalent is work with git submodules? I have found git submodules to often be poorly integrated in these environments leading to confusion and requiring fixes to get them to "just work".

@anonymouse64
Copy link
Member

Indeed somehow other PR's not touching this branch are somehow broken due to the existence of submodules, thus confirming my suspicion that submodules break everything they touch 😢

@anonymouse64
Copy link
Member

This branch broke our self-hosted runners, see actions/checkout#590, let's close this in the meantime so we can try to fix our self-hosted runners

@sergiocazzolato
Copy link
Collaborator Author

@anonymouse64 So I could validate that it shouldn't affect autopackage tests due we can remove the submodule configuration in case we need that before sync with launchpad in https://github.com/snapcore/spread-cron/blob/master/branches/snapd-vendor-sync/target/tasks/snapd-vendor-sync/task.yaml

Copy link
Member

@anonymouse64 anonymouse64 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 enough to me, let's merge it

Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

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

This looks fine, thanks for working on this. My only concern/wondering is if we could try a "git subtree" instead, I don't have much experience with either but I heard a lot of bad stories about usbmodules and people seems to be more happy with subtrees but I could be wrong here, happy to get others opinions.

@@ -282,6 +282,7 @@ jobs:
with:
# spread uses tags as delta reference
fetch-depth: 0
submodules: true
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if a git subtree might be an option?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mvo, thanks for the review, I already tried git subtree, both work well. Let me move to subtree and we can decide which is a better solution. Something that I faced last week and I didn't like it is that to use submodules you need git 2.18, and that could be a problem to clone the repo in an old distro.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mvo it is already updated using git subtree

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to remember that we need to pull changes from snapd-testing-tools project, but it has to be done as part of a PR I suppose.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@anonymouse64 @mvo5 please tell me what do you prefer, submodules or subtree?

Copy link
Member

Choose a reason for hiding this comment

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

TBH, I've never used subtree before, but it seems like a perfectly acceptable option so long as we don't create commits which span both the subtree and the main project. Let's try it.

@anonymouse64 anonymouse64 self-requested a review November 16, 2021 00:19
@mvo5
Copy link
Contributor

mvo5 commented Nov 16, 2021

This looks nice, thanks you! One thing maybe worth adding is how to update/list/keep-track of the subtree in a readme file, maybe as part of the test-tools themselfs?

@mvo5
Copy link
Contributor

mvo5 commented Nov 16, 2021

Also is it possible to squash-merge this? The history is now a bit noisy :)

@sergiocazzolato
Copy link
Collaborator Author

@mvo5 yes, it is ready to squash-merge, the error are unrelated.

@anonymouse64
Copy link
Member

I'm not sure if we can squash merge this, I have read that you shouldn't have commits which touch both the subtree and the main project at once because then importing new commits from the subtree repo will get confused with a different history to them and you will have to sort out those merges.

So probably the thing to do is to make sure that the file contents of the subtree is exactly the same as master tip in the other repo, then rebase this PR (or create a new one like this if that's easier) with two commits, one adding the subtree, and the other commit fixing up the rest of the snapd repo to operate using the subtree instead.

Copy link
Member

@anonymouse64 anonymouse64 left a comment

Choose a reason for hiding this comment

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

one super minor nitpick, but note that we should be careful about squash merging here and also I think we should have something in the repo somewhere that says "don't mix commits modifying the subtree with the main tree" or some such. Maybe we could even have something in run-checks / github actions which ensures that doesn't happen

also see my comment about how to proceed on merging this PR

def is_file_in_dirs(file, dirs):
for dir in dirs:
if os.path.abspath(file).startswith('{}/'.format(os.path.abspath(dir))):
print('Skipping {}'.format(file))
Copy link
Member

Choose a reason for hiding this comment

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

nitpick probably either the name of the function should change or the print message should be outside of this function since the name of the function suggests it is a generic function, but it has this print message in it which makes it less generic

@sergiocazzolato sergiocazzolato merged commit db86c2a into snapcore:master Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants