pharo
pharo copied to clipboard
[RB] Reduce the size of the model to speed the test executions
Often in the refactoring tests, a default model is used such as RBBrowserEnvironment default. This creates a model for the complete system (to be verified) and it is often not needed.
So producing smaller models should reduce the time spent in running the tests (this is so frustrating to wait) and it will speed up also the build.
We started to create specific environments for tests to control that preconditions do not escape the model (see other issue)
Here is a typical test. We create a model (aRBNamespace) only a single package. Sometimes for some tests we created a model only with two classes.
RBRemoveClassRefactoringTest >> testPreconditionNotEmptyClass
| refactoring package |
package := RBPackageEnvironment packageName: RBFooDummyLintRuleTest1 packageName.
model := RBNamespace onEnvironment: package.
refactoring := RBRemoveClassRefactoring
model: model
classNames: { ('RBTransformation' , 'RuleTestData1') asSymbol}.
self deny: (refactoring preconditionEmptyOrHasNoSubclasses: (refactoring model classNamed: ('RBTransformation' , 'RuleTestData1') asSymbol)) check.
So we should check and reduce the tests may be to a couple of kernel packages.