New issue
Advanced search Search tips

Issue 758056 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Task



Sign in to add a comment

Make service worker's unit tests more unit tests

Project Member Reported by shimazu@chromium.org, Aug 23 2017

Issue description

Currently several unit tests internally creates real ServiceWorkerRegistration and ServiceWorkerVersion for unit testing, and they kicks StartWorker procedure before starting the tests. However, it needs various classes like ServiceWorkerProviderHost, ServiceWorkerDispatcherHost and ServiceWorkerStorage, so it looks like integration tests rather than unit tests.

I think we should have 
- more unit test like unit tests with mocking minimal set of objects
- small integration tests like what we currently call unit tests
 
Project Member

Comment 1 by sheriffbot@chromium.org, Aug 23

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
shimazu: Would you like to keep this open or close it?

I think this is something that can be done on a case-by-case basis and doesn't need an open bug, especially since it hasn't gotten traction in one year.

I do agree many of our unit tests are overly tangled and especially there is common setup code copy/pasted throughout.

However in Chromium a unit test is basically anything that's not a browser test (which starts up the browser), so there's a wide definition of "unit test". It's not necessarily testing a single class in isolation:
https://www.chromium.org/developers/testing/running-tests#TOC-Unit-tests-and-Browser-tests
Thanks for pinging me :)

> I think this is something that can be done on a case-by-case basis and doesn't need an open bug, especially since it hasn't gotten traction in one year.

I agree with it.
However, honestly I still want to explore better shape of unit tests. I'm expecting that it might lead more isolated architecture or better lifetime aware relationships between classes.
I'm not sure if we really can do that, but I'd like to keep this open for a while.
Cc: -shimazu@chromium.org
Owner: shimazu@chromium.org
Status: Assigned (was: Untriaged)
Makes sense. Assigning to shimazu@.

Sign in to add a comment