sixty-north / cosmic-ray

Mutation testing for Python
MIT License
556 stars 54 forks source link

excluded-modules not working #530

Closed pythonclimber closed 1 year ago

pythonclimber commented 1 year ago

I am trying to incorporate cosmic-ray into a project for my team. Big fan of it so far, but I'm trying to use the 'excluded-modules' in the config for the first time and it appears to not be working. Here is my config:

[cosmic-ray] module-path = "entrypoint/src" timeout = 10.0 excluded-modules = ["**/app/lambda_handler.py"] test-command = "pytest tests/test_entrypoint"

[cosmic-ray.distributor] name = "local"

My directory structure for the project looks like this: -entrypoint -src -lambdas -entrypoint -app init.py lambda_handler.py store_policy_detail.py

Obviously, I'm attempting to exclude lambda_handler.py. When I run cosmic-ray init with this config, it is still creating mutations for that file. Am I doing something wrong? Has the behavior of excluded-modules changed from what is in the docs?

abingham commented 1 year ago

I did a quick test using the configuration and structure you described, and it seems to work properly. Could you possibly create a small example demonstrating the problem (e.g. as a gist or something) along with recreation instructions? It might help me to see exactly the code that's causing a problem along with exactly the steps needed to recreate it.

pythonclimber commented 1 year ago

@abingham I'm closing this issue. I'm still not sure why I was having it initially, but it's not longer an issue. If it's working as intended for you it was probably user error on my part.