|
|
Created:
4 years, 1 month ago by chfremer Modified:
4 years ago CC:
Aaron Boodman, abarth-chromium, chromium-reviews, darin (slow to review), posciak+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Description[Mojo Video Capture] Separate testing from production code
The goal of this CL is to get a clear separation of testing-only code
from production code in services/video_capture.
* Removed testing-only APIs and code from production service "video_capture"
* Created new service "testable_video_capture" which is a superset of
"video_capture" that additionally exposes testing-only APIs and links
testing-only code.
* Moved testing-only code to subfolder test.
This CL is part of the Mojo Video Capture work. For the bigger picture,
see [1] CL1.9.5b
BUG=584797
TEST=video_capture_unittests, content_unittests, capture_unittests
[1] https://docs.google.com/a/chromium.org/document/d/1Qw7rw1AJy0QHXjha36jZNiEuxsxWslJ_X-zpOhijvI8/edit?usp=sharing
Committed: https://crrev.com/4c0567125d08240ce3512a13ede21e21e7b8a269
Cr-Commit-Position: refs/heads/master@{#433798}
Patch Set 1 #Patch Set 2 : Have MockDeviceTest exercise service impl directly instead of going through service shell #Patch Set 3 : Removed #include of removed header file. #Patch Set 4 : Similarity 25 #Messages
Total messages: 29 (16 generated)
Description was changed from ========== presubmit Merge branch '1.9.5a' into 1.9.5b Merge branch '1.9.5a' into 1.9.5b Merge branch '1.9.5a' into 1.9.5b Merge branch '1.9.5a' into 1.9.5b Merge branch '1.9.5a' into 1.9.5b Finished separation of test code. Mostly done, but mock_device_test unable to add mock device. WIP WIP WIP separate testing from production BUG= ========== to ========== [Mojo Video Capture] Separate testing from production code The goal of this CL is to get a clear separation of testing-only code from production code in services/video_capture. * Removed testing-only APIs and code from production service "video_capture" * Created new service "testable_video_capture" which is a superset of "video_capture" that additionally exposes testing-only APIs and links testing-only code. * Moved testing-only code to subfolder test. This CL is part of the Mojo Video Capture work. For the bigger picture, see [1] CL1.9.5b BUG=584797 TEST=video_capture_unittests, content_unittests, capture_unittests [1] https://docs.google.com/a/chromium.org/document/d/1Qw7rw1AJy0QHXjha36jZNiEuxs... ==========
chfremer@chromium.org changed reviewers: + emircan@chromium.org, mcasas@chromium.org, rockot@chromium.org
mcasas@: PTAL rockot@: Please give feedback on approach from a Mojo perspective emircan@: FYI
On 2016/11/16 22:05:40, chfremer wrote: > mcasas@: PTAL > rockot@: Please give feedback on approach from a Mojo perspective > emircan@: FYI ping
I am a bit confused by this approach. Why define a new service just for tests? Why not just unit-test the individual components of the service? And if you need integration testing, it doesn't seem like a separate test service actually provides that coverage. In general the pattern of having a testable_foo_service for every foo_service seems highly undesirable and I would like to avoid it.
On 2016/11/17 22:27:17, Ken Rockot wrote: > I am a bit confused by this approach. Why define a new service just for tests? > Why not just unit-test the individual components of the service? > > And if you need integration testing, it doesn't seem like a separate test > service actually provides that coverage. > > In general the pattern of having a testable_foo_service for every foo_service > seems highly undesirable and I would like to avoid it. Thanks, Ken. That is very useful feedback. I guess my idea was to have a component test that tests the service "from the outside", such that test coverage includes both the implementation and the "wrapping" service shell. But you are right, that using a separate service for testing makes the coverage of the "wrapping" service shell useless. Some of the tests still exercise the production service, i.e. ServiceTest, FakeDeviceDescriptorTest, and FakeDeviceTest. Let me change the MockDeviceTest so that it still tests the component "as a whole" but does so "from the inside", i.e. not going through a service boundary. This should eliminate the need for the separate service. Will post back as a PatchSet.
PTAL I modified MockDeviceTest to exercise the service implementation direction instead of going through the service shell. This gives us the same test coverage, but eliminates a lot of overhead. In particular, we no longer have to wrap mock devices to control them across a Mojo boundary.
On 2016/11/18 00:23:36, chfremer wrote: > PTAL > > I modified MockDeviceTest to exercise the service implementation direction > instead of going through the service shell. This gives us the same test > coverage, but eliminates a lot of overhead. In particular, we no longer have to > wrap mock devices to control them across a Mojo boundary. ping
lgtm
lgtm
chfremer@chromium.org changed reviewers: + tsepez@chromium.org
tsepez@: Please RS *.mojom
RS LGTM
The CQ bit was checked by chfremer@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_clobber_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by chfremer@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by chfremer@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from tsepez@chromium.org, rockot@chromium.org, mcasas@chromium.org Link to the patchset: https://codereview.chromium.org/2505143002/#ps40001 (title: "Removed #include of removed header file.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 40001, "attempt_start_ts": 1479793796060060, "parent_rev": "e0ae7aa6e7a054ee274a4102f9df2d64dfb62b20", "commit_rev": "ca3df55255066e49bc920465937a6150dfe867dc"}
Message was sent while issue was closed.
Description was changed from ========== [Mojo Video Capture] Separate testing from production code The goal of this CL is to get a clear separation of testing-only code from production code in services/video_capture. * Removed testing-only APIs and code from production service "video_capture" * Created new service "testable_video_capture" which is a superset of "video_capture" that additionally exposes testing-only APIs and links testing-only code. * Moved testing-only code to subfolder test. This CL is part of the Mojo Video Capture work. For the bigger picture, see [1] CL1.9.5b BUG=584797 TEST=video_capture_unittests, content_unittests, capture_unittests [1] https://docs.google.com/a/chromium.org/document/d/1Qw7rw1AJy0QHXjha36jZNiEuxs... ========== to ========== [Mojo Video Capture] Separate testing from production code The goal of this CL is to get a clear separation of testing-only code from production code in services/video_capture. * Removed testing-only APIs and code from production service "video_capture" * Created new service "testable_video_capture" which is a superset of "video_capture" that additionally exposes testing-only APIs and links testing-only code. * Moved testing-only code to subfolder test. This CL is part of the Mojo Video Capture work. For the bigger picture, see [1] CL1.9.5b BUG=584797 TEST=video_capture_unittests, content_unittests, capture_unittests [1] https://docs.google.com/a/chromium.org/document/d/1Qw7rw1AJy0QHXjha36jZNiEuxs... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== [Mojo Video Capture] Separate testing from production code The goal of this CL is to get a clear separation of testing-only code from production code in services/video_capture. * Removed testing-only APIs and code from production service "video_capture" * Created new service "testable_video_capture" which is a superset of "video_capture" that additionally exposes testing-only APIs and links testing-only code. * Moved testing-only code to subfolder test. This CL is part of the Mojo Video Capture work. For the bigger picture, see [1] CL1.9.5b BUG=584797 TEST=video_capture_unittests, content_unittests, capture_unittests [1] https://docs.google.com/a/chromium.org/document/d/1Qw7rw1AJy0QHXjha36jZNiEuxs... ========== to ========== [Mojo Video Capture] Separate testing from production code The goal of this CL is to get a clear separation of testing-only code from production code in services/video_capture. * Removed testing-only APIs and code from production service "video_capture" * Created new service "testable_video_capture" which is a superset of "video_capture" that additionally exposes testing-only APIs and links testing-only code. * Moved testing-only code to subfolder test. This CL is part of the Mojo Video Capture work. For the bigger picture, see [1] CL1.9.5b BUG=584797 TEST=video_capture_unittests, content_unittests, capture_unittests [1] https://docs.google.com/a/chromium.org/document/d/1Qw7rw1AJy0QHXjha36jZNiEuxs... Committed: https://crrev.com/4c0567125d08240ce3512a13ede21e21e7b8a269 Cr-Commit-Position: refs/heads/master@{#433798} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/4c0567125d08240ce3512a13ede21e21e7b8a269 Cr-Commit-Position: refs/heads/master@{#433798} |