opsmill / infrahub

Infrahub - A new approach to Infrastructure Management
https://opsmill.com/
GNU Affero General Public License v3.0
144 stars 7 forks source link

bug: SDK test framework tries to run non-Infrahub tests #2221

Open gmazoyer opened 4 months ago

gmazoyer commented 4 months ago

Component

Python SDK

Current Behavior

The SDK test framework is gathering tests from the root of a repository which means that if a user defines tests, which are not Infrahub related tests, they will get collected and be run as part of the test sessions.

This behaviour can, in the best case scenario create user confusion, and in the worst case scenario make the test session fail.

Expected Behavior

Only tests defined as Infrahub tests should be run, other tests should be ignored from collection.

Steps to Reproduce

Additional Information

No response

gmazoyer commented 4 weeks ago

I'm not sure we can really fix this. It looks like tests are being collected by pytest without the capability to exclude them before parsing. The only thing we could do is to force Infrahub tests to be located in a specific directory in user repos and run the test pipeline against that directory.