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

Allow running tests in nixpkgs #951

Closed
expipiplus1 opened this issue Jun 12, 2021 · 1 comment
Closed

Allow running tests in nixpkgs #951

expipiplus1 opened this issue Jun 12, 2021 · 1 comment

Comments

@expipiplus1
Copy link
Collaborator

At the moment nixpkgs uses dontCheck for hnix due to some tests requiring network access.

-- From https://github.com/input-output-hk/ouroboros-network
-- | Infer from environment variables whether we are running within a Nix build
-- (and not just a nix-shell).
inNixBuild :: IO Bool
inNixBuild = do
  let testEnv = fmap (maybe False (not . null)) . System.Environment.lookupEnv
  haveNixBuildDir <- testEnv "NIX_BUILD_TOP"
  inNixShell      <- testEnv "IN_NIX_SHELL"
  pure (haveNixBuildDir && not inNixShell)

Something like this can be used to determine when to gate such tests.

@expipiplus1
Copy link
Collaborator Author

Duplicate of #618

@expipiplus1 expipiplus1 marked this as a duplicate of #618 Jun 14, 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
Development

No branches or pull requests

1 participant