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

Curl tests fail when offline #221

Closed
wigust opened this issue Mar 23, 2018 · 6 comments
Closed

Curl tests fail when offline #221

wigust opened this issue Mar 23, 2018 · 6 comments

Comments

@wigust
Copy link

wigust commented Mar 23, 2018

Hello,

Seems da78813 has the same issue as #192

make test requires internet connection because of Curl tests.

[FAIL] ( 1/1 ) TESTING curl()
assertEqual:  IS NOT EQUAL TO https://httpbin.org/get
[FAIL] ( 1/1 ) TESTING curlPost()
assertEqual:  IS NOT EQUAL TO https://httpbin.org/post
@soimort
Copy link
Owner

soimort commented Mar 23, 2018

This is an intended behavior since I use it as a sanity check for the curl tool, which trans optionally depends on.

What do you expect then? (You can always skip those tests as if they don't exist.)

@wigust
Copy link
Author

wigust commented Mar 24, 2018

What do you expect then?

I except a make target for testing which doesn't require a network access (it was a test target, as I understand).

You can always skip those tests as if they don't exist.

Could you recommend a way to do it, please?

I think about removing @include "test/TestUtils" from test/Test.awk with a sed like utility in Guix. It doesn't look great though, because e.g. Gentoo folks should do the same a different way as was mentioned in #192.

@soimort
Copy link
Owner

soimort commented Mar 24, 2018

Not sure about your specific use case here, so my apologies if these questions sound too dull to you: 1. Are you a package maintainer or a user, and why would you need to run make test after all? 2. What is your environment, and why does it forbid tests from network access?

Here's my suggestions:

  1. On Arch, the makepkg --nocheck option is used to skip all tests in PKGBUILD. I'm sure you'll find a similar option for other Linux distros.
  2. In case you are packaging trans on a distro that forbids network access (e.g., Gentoo), I recommend simply adding a patch that delete L33-L49.

@wigust
Copy link
Author

wigust commented Mar 24, 2018

Not sure about your specific use case here, so my apologies if these questions sound too dull to you:

It's not dull, no problem. Always welcome!

  1. Are you a package maintainer or a user?

I'm a translate-shell user for a long time. Also I maintain and write packages for Guix. Specifically we have a guix refresh command to upgrade a package recipe. I want to upgrade it. Upgrade from 0.9.6.4 to 0.9.6.7 is not possible without modifying translate-shell tests code.

and why would you need to run make test after all?

We test all package recipes to insure they work as expected. It's possible to push a package without tests too, but still we would like to test them if it's possible.

  1. What is your environment?

Build processes in a chroot, under one of the ‘guixbuilder’ users. The chroot environment contains nothing but:

  • a minimal ‘/dev’ directory, created mostly independently from the host ‘/dev’(2);

  • the ‘/proc’ directory; it only shows the processes of the container since a separate PID name space is used;

  • ‘/etc/passwd’ with an entry for the current user and an entry for user ‘nobody’;

  • ‘/etc/group’ with an entry for the user’s group;

  • ‘/etc/hosts’ with an entry that maps ‘localhost’ to ‘127.0.0.1’;

  • a writable ‘/tmp’ directory.

https://www.gnu.org/software/guix/manual/html_node/Build-Environment-Setup.html

and why does it forbid tests from network access?

Guix targets reproducible builds. We cannot archive them with a network access, so all packages are build without it.

Here's my suggestions:

On Arch, the makepkg --nocheck option is used to skip all tests in PKGBUILD. I'm sure you'll find a similar option for other Linux distros.

In case you are packaging trans on a distro that forbids network access (e.g., Gentoo), I recommend simply adding a patch that delete L33-L49.

OK, thank you.

Still it would be helpful to have a make target for testing without network access to decrease amount of the same work for multiple distributions, e.g. Gentoo, NixOS, GuixSD.

Also Debian probably does without network access too, because they are one of the favorites of reproducible builds. https://reproducible-builds.org/

@soimort
Copy link
Owner

soimort commented Mar 25, 2018

Thanks for the detailed clarification! I had barely any knowledge about Guix and it's good to know how things are supposed to work under different systems.

Network-dependent tests are not going away, since they could be useful and gives Travis CI the possibility to shout out when something's broken. However, I have made it aware of an environment variable $NETWORK_ACCESS, so that it's possible to perform tests without any network now:

$ make NETWORK_ACCESS=no test

Hope that helps. (this will take effect on the next release)

@wigust
Copy link
Author

wigust commented Mar 25, 2018

Thank you! I succeeded to build and test bb9f32d

I'll close the issue.

@wigust wigust closed this as completed Mar 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants