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

doctest: Allow skipping certain files / only testing a subset of files #519

Open
sternenseemann opened this issue Jun 5, 2021 · 3 comments

Comments

@sternenseemann
Copy link

Since there is no way to make doctest skip a certain example which would be impossible to do on CI for example, skipping a file altogether is desireable in some cases.

@phadej
Copy link
Collaborator

phadej commented Jun 5, 2021

Teach doctest to skip files somehow, then we can benefit from it running doctest locally and in CI. CI only setup is not a good idea.

@sternenseemann
Copy link
Author

I can do that locally by specifying a set of files I want to run it on. haskell-ci always throws it at the entirety of hs-source-dirs afaiu, so at least specifying a (exclude) file list there would be nice.

sternenseemann added a commit to sternenseemann/distribution-nixpkgs that referenced this issue Jun 5, 2021
Since both haskell-ci (even with cabal-docspec) and doctest insist that
there should be no way to skip even a single example in the
documentation that may not be doctest-able because of impurities or
requirements in terms of environment, we have to use code blocks instead
of the more semantic example entries in haddock markup to prevent it
from trying to invoke nix-instantiate in CI which won't work in an
ubuntu docker container.

In the future we may be able to skip the file altogether either via a
patch to the generated output or whatever resolves this issue:
haskell-CI/haskell-ci#519
sternenseemann added a commit to sternenseemann/distribution-nixpkgs that referenced this issue Jun 5, 2021
We use haskell-ci's weird feature to apply a patch to the workflow file
in order to not test PackageMap.hs using doctest since it will always
fail -- there seems to be no way to install nix in haskell-ci's ubuntu
docker containers.

We can hopefully drop this if the following issue gets some kind of
resolution:
haskell-CI/haskell-ci#519
sternenseemann added a commit to sternenseemann/distribution-nixpkgs that referenced this issue Jun 5, 2021
We use haskell-ci's weird feature to apply a patch to the workflow file
in order to not test PackageMap.hs using doctest since it will always
fail -- there seems to be no way to install nix in haskell-ci's ubuntu
docker containers.

We can hopefully drop this if the following issue gets some kind of
resolution:
haskell-CI/haskell-ci#519
@phadej
Copy link
Collaborator

phadej commented Jun 5, 2021

hs-source-dirs is a simple approach i.e. doesn't require manual (re)configuration of the CI script. I won't fix this myself, but I'll leave open for someone to propose some approach, and how it would work.

Specifically, I'm not thrilled of a possible idea that haskell-ci would scan what file is in the hs-source-dirs to then exclude something.

sternenseemann added a commit to sternenseemann/distribution-nixpkgs that referenced this issue Jun 5, 2021
We use haskell-ci's weird feature to apply a patch to the workflow file
in order to not test PackageMap.hs using doctest since it will always
fail -- there seems to be no way to install nix in haskell-ci's ubuntu
docker containers.

We can hopefully drop this if the following issue gets some kind of
resolution:
haskell-CI/haskell-ci#519
sternenseemann added a commit to NixOS/cabal2nix that referenced this issue Jul 21, 2022
We use haskell-ci's weird feature to apply a patch to the workflow file
in order to not test PackageMap.hs using doctest since it will always
fail -- there seems to be no way to install nix in haskell-ci's ubuntu
docker containers.

We can hopefully drop this if the following issue gets some kind of
resolution:
haskell-CI/haskell-ci#519
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