Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed default budget #115

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions src/MuTalk-Model/MTAnalysis.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,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 @@ -175,7 +174,8 @@ MTAnalysis >> initialize [
mutantResults := OrderedCollection new.
elapsedTime := 0.
logger := self defaultLogger.
stopOnErrorOrFail := true
stopOnErrorOrFail := true.
budget := self defaultBudget
]

{ #category : 'accessing' }
Expand Down Expand Up @@ -277,8 +277,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 := [
self generateCoverageAnalysis.
Expand All @@ -292,14 +291,6 @@ MTAnalysis >> run [
false ]
]

{ #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
Loading