Skip to content

[Question] Is there any way to specify wildcard match expression for the subjects? #1272

Closed
@omaik

Description

@omaik

** Summary:

I have a rails project, on which I want to configure the CI job, to run mutations for all changed classes in incremental mode.

My .mutant.yml

integration: rspec
includes:
  - config
requires:
  - environment.rb

** Commands that work fine:

RAILS_ENV=test bundle exec mutant run -- 'ModuleName*'

RAILS_ENV=test bundle exec mutant run --since master -- 'ModuleName*'

** Problem :

I would like to run mutations across ALL classes. Since this is a Rails project, there are many top-level classes(Models, Controllers, etc). It will be painful to specify all of them in the config file, and someone may forget to add there a new class.

Tried something like these, but mutant does not match any subject.

RAILS_ENV=test bundle exec mutant run -- '*'
RAILS_ENV=test bundle exec mutant run 
RAILS_ENV=test bundle exec mutant run -- 'Object*' 

# RAILS_ENV=test bundle exec mutant run -- '*' 
warning: parser/current is loading parser/ruby26, which recognizes
warning: 2.6.8-compliant syntax, but you are running 2.6.6.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Module#name from: REXML::Functions raised an error: #<NoMethodError: undefined method `[]' for nil:NilClass>. Fix your lib to follow normal ruby semantics!
{Module,Class}#name should return resolvable constant name as String or nil
Mutant environment:
Matcher:         #<Mutant::Matcher::Config subjects: [*]>
Integration:     rspec
Jobs:            16
Includes:        ["config"]
Requires:        ["environment.rb"]
Subjects:        0
Total-Tests:     330
Selected-Tests:  0
Tests/Subject:   0.00 avg
Mutations:       0
Mutant environment:
Matcher:         #<Mutant::Matcher::Config subjects: [*]>
Integration:     rspec
Jobs:            16
Includes:        ["config"]
Requires:        ["environment.rb"]
Subjects:        0
Total-Tests:     330
Selected-Tests:  0
Tests/Subject:   0.00 avg
Mutations:       0
Results:         0
Kills:           0
Alive:           0
Timeouts:        0
Runtime:         0.09s
Killtime:        0.00s
Overhead:        Inf%
Mutations/s:     0.00
Coverage:        100.00%

Probably I just doing something wrong and missing obvious stuff, please forgive me for that.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions