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
test(forms): refactor integration tests to improve speed #13500
Conversation
db88879
to
ccf1cc1
Compare
] | ||
}); | ||
}); | ||
function initTest(...args: any[]): ComponentFixture<any> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(component: Type, ...directives: Type[])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function initTest<T>(component: Type<T>, ...directives: Type[]): ComponentFixture<T>
could be even better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
17f4bda
to
54e4c49
Compare
54e4c49
to
4ddc56a
Compare
I believe router has the same issue https://github.com/angular/angular/blob/master/modules/%40angular/router/test/integration.spec.ts |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
While investigating browser disconnections in SauceLabs, I found out that the forms integration test were quite slow and CPU intensive.
Using
TestBed.configureTestingModule()
for all components inbeforeEach()
is clearly not ideal.These 130 tests were taking 13s to run on my machine.
With these changes,the only take 4s!!!
As a result, the full campaign goes from 43s to 34s.
Hopefully, this will also help with the disconnections.
But it might not be enough ...