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

[EDNA-95] Run pytest on CI #85

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

gromakovsky
Copy link
Member

Description

Problem: we have tests for Python code, but CI doesn't run them,
so they may silently break.

Solution: add a new CI step that calls pytest in nix-shell.

Related issue(s)

Resolve https://issues.serokell.io/issue/EDNA-95

✅ Checklist for your Pull Request

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:

Stylistic guide (mandatory)

Problem: we have tests for Python code, but CI doesn't run them,
so they may silently break.

Solution: add a new CI step that calls `pytest` in `nix-shell`.
@gromakovsky gromakovsky self-assigned this May 3, 2021
@gromakovsky
Copy link
Member Author

@mkaito I tried the simplest possible approach that came to my mind and it seems to work. Is it good enough?

Alternatively, I can add some test to analysis/default.nix and then have checks.analysis-test in flake.nix, but I don't know how to define this test. So if you think we should have test in analysis/default.nix, please help me to define it. Currently we just export env built by mkPoetryEnv. AFAIU I should return an object with env = mkPoetryEnv … and test = ???

@gromakovsky gromakovsky requested a review from mkaito May 3, 2021 12:21
@mkaito
Copy link
Contributor

mkaito commented May 5, 2021

Our verification steps should all be encoded as flake checks, as per Elagin. I'd have to look into how Poetry works on Nix, I'm not familiar (yet).

@kirelagin
Copy link

That’s exactly how it works, yes, you get the stuff from the Poetry env on your PATH and then run pytest. Just make it into a check instead of running nix-shell in the pipeline config directly.

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 this pull request may close these issues.

3 participants