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

test(forms): refactor integration tests to improve speed #13500

Merged
merged 1 commit into from Dec 16, 2016

Conversation

marclaval
Copy link
Contributor

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 in beforeEach() 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 ...

@marclaval marclaval added the action: review The PR is still awaiting reviews from at least one requested reviewer label Dec 15, 2016
]
});
});
function initTest(...args: any[]): ComponentFixture<any> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(component: Type, ...directives: Type[])

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@vicb vicb added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews pr_state: LGTM and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 15, 2016
@marclaval marclaval force-pushed the formsTestRefactor branch 2 times, most recently from 17f4bda to 54e4c49 Compare December 15, 2016 21:50
@marclaval marclaval added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Dec 15, 2016
@chuckjaz chuckjaz merged commit 55dfa1b into angular:master Dec 16, 2016
@DzmitryShylovich
Copy link
Contributor

@marclaval marclaval deleted the formsTestRefactor branch December 11, 2017 10:02
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants