Skip to content

Commit

Permalink
Merge pull request #115 from DurieuxPol/fix/defaultBudget
Browse files Browse the repository at this point in the history
Changed default budget
  • Loading branch information
guillep authored May 3, 2024
2 parents e4e6ce8 + ebc0898 commit 693737a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
16 changes: 4 additions & 12 deletions src/MuTalk-Model/MTAnalysis.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ MTAnalysis >> coverageAnalysisResult: anObject [

{ #category : 'accessing - defaults' }
MTAnalysis >> defaultBudget [
"Since tests often take little time to run, we multiply it by 30"

^ MTTimeBudget for: self totalTestsTime * 30
^ MTTimeBudget for: 5 minutes
]

{ #category : 'accessing - defaults' }
Expand Down Expand Up @@ -181,7 +180,8 @@ MTAnalysis >> initialize [
mutantResults := OrderedCollection new.
elapsedTime := 0.
logger := self defaultLogger.
stopOnErrorOrFail := true
stopOnErrorOrFail := true.
budget := self defaultBudget
]

{ #category : 'accessing' }
Expand Down Expand Up @@ -295,7 +295,7 @@ MTAnalysis >> run [
self initialTestRun.

"The budget is started after the initial test run because the default one needs the run time of tests"
self startBudget.
budget start.
logger logAnalysisStartFor: self.

elapsedTime := [
Expand All @@ -304,14 +304,6 @@ MTAnalysis >> run [
self generateResults ] timeToRun
]

{ #category : 'starting' }
MTAnalysis >> startBudget [
"The budget is initialized here because the default one needs the run time of tests, so the initial test run must be executed first"

budget ifNil: [ budget := self defaultBudget ].
budget start
]

{ #category : 'accessing' }
MTAnalysis >> stopOnErrorOrFail: aBoolean [

Expand Down
11 changes: 0 additions & 11 deletions src/MuTalk-Tests/MTAnalysisTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,6 @@ MTAnalysisTest >> testErrorWhenInitializingDefaultTestFilterBeforeInitialTestRun
self should: [ analysis initializeTestFilter ] raise: Error
]

{ #category : 'tests' }
MTAnalysisTest >> testErrorWhenStartingDefaultBudgetBeforeInitialTestRun [

| analysis |
analysis := MTAnalysis new
classesToMutate: { MTAuxiliarClassForMTAnalysis };
testClasses: { MTAuxiliarClassForMTAnalysisTest }.

self should: [ analysis startBudget ] raise: Error
]

{ #category : 'tests' }
MTAnalysisTest >> testErrorWhenTryingToGetPercentileOfEmptyCollection [

Expand Down

0 comments on commit 693737a

Please sign in to comment.