Skip to content

Smoke tests are not independent #726

Description

@planetmarshall

Summary

The smoke tests provided in test_smoke.py are not independent, and their success depends on the order in which they are run

Expected Behaviour

The success of a test should be independent of the order in which it is run, and whether it is run in isolation or as part of a suite.

Actual Behaviour

Tests currently succeed only by coincidental choice of running order and specific expectation values

Steps to reproduce:

  1. Modify test_single_config so that it asserts that a Debug config is installed (or anything except Release).
  2. Run pytest -k test_single_config. The three selected tests should pass:
    collected 61 items / 58 deselected / 3 selected                                                                                                                      
    
    test_smoke.py::TestBasic::test_single_config PASSED                                                                [ 33%]
    test_smoke.py::TestBasic::test_single_config_only_one_configuration_installed PASSED        [ 66%]
    test_smoke.py::TestBasic::test_single_config_override_install_config PASSED                         [100%]
    
  3. Move test_single_config so that it runs after test_single_config_override_install_config
    Run the tests again with pytest -k test_single_config. Now test_single_config will fail.
    collected 61 items / 58 deselected / 3 selected                                                                                                                      
    
    
    test_smoke.py::TestBasic::test_single_config_only_one_configuration_installed PASSED         [ 33%]
    test_smoke.py::TestBasic::test_single_config_override_install_config PASSED                          [66%]
    test_smoke.py::TestBasic::test_single_config FAILED                                                                   [100%]
    
  4. If test_single_config is now run in isolation with pytest -k 'test_single_config and not test_single_config_o', it will pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions