Skip to content

[EDNA-95] Run pytest on CI#85

Draft
gromakovsky wants to merge 1 commit into
masterfrom
gromak/edna95-pytest-ci
Draft

[EDNA-95] Run pytest on CI#85
gromakovsky wants to merge 1 commit into
masterfrom
gromak/edna95-pytest-ci

Conversation

@gromakovsky

Copy link
Copy Markdown
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
Copy Markdown
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

mkaito commented May 5, 2021

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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