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

Test suite fails if there is no network access #9

Closed
peti opened this issue Jul 26, 2013 · 6 comments
Closed

Test suite fails if there is no network access #9

peti opened this issue Jul 26, 2013 · 6 comments

Comments

@peti
Copy link

peti commented Jul 26, 2013

In NixOS, we run all builds (and their test suites) in a protected environment which restricts what those packages can do. For example, builds do not have network access. This means that the current version of dns can no longer pass its test suite: http://hydra.cryp.to:8080/build/6557/nixlog/2/raw.

Is there any way to run the test suite in such a way that those parts that require network access are disabled?

@kazu-yamamoto
Copy link
Owner

It's hard but possible.

You should prepare a mock DNS server and customize dns with RCHostName to look up the local mock DNS server.

@peti
Copy link
Author

peti commented Jul 30, 2013

Wouldn't it be much easier to split the test suite in two parts: one that requires network access and one that doesn't?

@kazu-yamamoto
Copy link
Owner

It's a piece of cake. I created a new branch "test2". Please look. For non-network test, type "cabal test spec".

@peti
Copy link
Author

peti commented Aug 17, 2013

Very nice. Would it be possible to get that updated version via Hackage?

@kazu-yamamoto
Copy link
Owner

Done!

@peti
Copy link
Author

peti commented Aug 26, 2013

I've re-enabled the test suite in NixOS in commit 884a8fc7. Thank you for your help!

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

No branches or pull requests

2 participants