apache / apache/buildstream

Cannot directly invoke pytest

Open
#1,744 0 comments 0 reactions 0 assignees View on GitHub
bug tests
Dominant language
Python
Stars
140
Forks
45
Avg merge
1d 3h
Merged PRs (30d)
6

Description

As documented in the hacking materials: https://docs.buildstream.build/master/hacking/using_the_testsuite.html#running-tests:

> While using `tox` is practical for developers running tests in more predictable execution environments, it is still possible to execute the test suite against a specific installation environment using pytest directly

This is especially a requirement for distro packaging in order to run our test suite against the installed dependencies instead of relying on having internet access in order to run tests.

The `--integration` tests unfortunately cannot be run at all under these conditions at all but we should be able to run tests with `pytest` directly given all the dependencies are already present.

This is no longer working, we get the following error for every test:

```
_______________________________________________________ ERROR at teardown of test_artifact_cache_with_missing_capabilities_is_skipped ________________________________________________________

default_thread_number = 1

@pytest.fixture(autouse=True)
def thread_check(default_thread_number):
assert has_no_unexpected_background_threads(default_thread_number)
yield
> assert has_no_unexpected_background_threads(default_thread_number)
E AssertionError

../../.local/lib/python3.9/site-packages/buildstream/_testing/_fixtures.py:57: AssertionError
```

Contributor guide

Open the contributing guide

Research direction

Start with the hacking documentation on running tests and the pytest fixture shown at buildstream/_testing/_fixtures.py:57. Run the test suite directly with pytest in an installed-dependency environment and investigate the teardown thread assertion. Done means non-integration tests run successfully without tox, while the documented integration-test limitation remains understood.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.