h1alexbel / sr-detection

Identifying GitHub "sample repositories" (SR), that mostly contain educational or demonstration materials supposed to be copied instead of reused as a dependency
MIT License
6 stars 0 forks source link

integration tests should run separately #33

Open h1alexbel opened 2 weeks ago

h1alexbel commented 2 weeks ago

now, if I run poetry run pytest it would run all tests. However, some of them are intended to be integration tests and run with specific setup. For instance:

self = environ({'TERM_PROGRAM': 'iTerm.app', '_P9K_TTY': '/dev/ttys002', 'TERM': 'xterm-256color', 'SHELL': '/bin/zsh', 'HOME...'8.3.2', 'PYTEST_CURRENT_TEST': 'sr-data/src/tests/test_embed.py::TestEmbed::test_creates_csv_with_embeddings (call)'})
key = 'HF_TESTING_TOKEN'

>   ???
E   KeyError: 'HF_TESTING_TOKEN'

<frozen os>:714: KeyError
____________________________________________________________________________________ TestEmbed.test_returns_embeddings _____________________________________________________________________________________

self = <test_embed.TestEmbed testMethod=test_returns_embeddings>

    def test_returns_embeddings(self):
        """
        Test case for returning embeddings for text.
        """
        embeddings = infer(
            ["some dummy text"],
            "sentence-transformers/all-MiniLM-L6-v2",
>           os.environ["HF_TESTING_TOKEN"]
        )

sr-data/src/tests/test_embed.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = environ({'TERM_PROGRAM': 'iTerm.app', '_P9K_TTY': '/dev/ttys002', 'TERM': 'xterm-256color', 'SHELL': '/bin/zsh', 'HOME...ERSION': '8.3.2', 'PYTEST_CURRENT_TEST': 'sr-data/src/tests/test_embed.py::TestEmbed::test_returns_embeddings (call)'})
key = 'HF_TESTING_TOKEN'

>   ???
E   KeyError: 'HF_TESTING_TOKEN'

<frozen os>:714: KeyError
========================================================================================= short test summary info ==========================================================================================
FAILED sr-data/src/tests/test_embed.py::TestEmbed::test_creates_csv_with_embeddings - KeyError: 'HF_TESTING_TOKEN'
FAILED sr-data/src/tests/test_embed.py::TestEmbed::test_returns_embeddings - KeyError: 'HF_TESTING_TOKEN'
======================================================================================= 2 failed, 1 passed in 7.89s =====

let's separate such tests from units

github-actions[bot] commented 2 weeks ago

@h1alexbel Here is a summary of the bug report with 1 main quality problem and 1 specific suggestion:

Main quality problem: Lack of clear reproduction steps. Suggestion: Add a step-by-step guide on how to reproduce the error, including any specific environment setup required.