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

Debian packaging #76

Closed
suntong opened this issue Mar 18, 2020 · 5 comments · Fixed by #78
Closed

Debian packaging #76

suntong opened this issue Mar 18, 2020 · 5 comments · Fixed by #78

Comments

@suntong
Copy link
Contributor

suntong commented Mar 18, 2020

Following up with #43

I'm packaging fsutil in preparing for the upcoming docker cli packaging.
However, I'm facing difficulties doing that due the test needs to be done as root.
There is a lengthy discussion in debian-go dlist at
https://lists.debian.org/debian-go/2020/03/msg00106.html

Do you have any suggestions how I can proceed?
If I need to change the test files to incorporate Debian packaging, would you accept my PRs?

thanks

@suntong
Copy link
Contributor Author

suntong commented Mar 21, 2020

My plan is to mark all failed test to be skipped at Debian-build time with a call to the Skip method --

    if testing.Short() {
        t.Skip("skipping test that would fail in Debian-build.")
    }

However, the down side is that, it also means the test in short mode has an ambiguous meaning.

Due to my limited knowledge, this is the only way I know that can make it working.

@suntong
Copy link
Contributor Author

suntong commented Mar 21, 2020

the down side is that, it also means the test in short mode has an ambiguous meaning

This will remove the ambiguity:

if testing.Short() && os.Getenv("DEB_BUILD_ARCH_OS") != ""  {
    t.Skip("skipping test that would fail in Debian-build.")
}

So now the changes will not have side effects.

Would you accept my PRs in this case?

@tonistiigi
Copy link
Owner

we can just skip things that require root. We already have smth like this

func requiresRoot(t *testing.T) {

@suntong
Copy link
Contributor Author

suntong commented Mar 28, 2020

Thanks @tonistiigi, I'll skip the rest that require root and failed in Debian packaging, and submit a PR...

@suntong
Copy link
Contributor Author

suntong commented Mar 28, 2020

Done. Please approve #78 and tag a new release.

tonistiigi added a commit that referenced this issue Mar 31, 2020
- [*] skip tests that would fail in Debian-build, closes #76
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 a pull request may close this issue.

2 participants