Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Issue 1384243002: Adds the ability to run pure Go unit tests in the Mojo test suite. (Closed)

Created:
5 years, 2 months ago by rudominer
Modified:
5 years, 2 months ago
Reviewers:
viettrungluu, ppi
CC:
azani, mojo-reviews_chromium.org, gregsimon, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Adds the ability to run pure Go unit tests in the Mojo test suite. Go tests are run by changing into a directory containing a Go package and at least one file named *_test.go and invoking "go test". The go tool automatically builds the test binary in a temp directory and then runs it. This CL just sets up the infrastructure for running these tests as part of the Mojo test suite. It adds a couple of dummy tests to check that the infrastructure works. BUG=#461 R=ppi@chromium.org, viettrungluu@chromium.org, ppi Committed: https://chromium.googlesource.com/external/mojo/+/5bb65cc1b4f88ee8b26300301a4eda118a134457

Patch Set 1 #

Total comments: 27

Patch Set 2 : Respond to code review comments. #

Total comments: 7

Patch Set 3 : Responds to code review commnets. #

Total comments: 11

Patch Set 4 : Specify pats to directories in a data file. Plus other fixes. #

Total comments: 4

Patch Set 5 : Further code review comment responses. #

Total comments: 3

Patch Set 6 : Refactors go.py and uses it to invoke the go tool. #

Patch Set 7 : Adds dummy go tests to run. #

Total comments: 16

Patch Set 8 : Moved InvokeGo() to new script under mopy. #

Patch Set 9 : Tweak some comments. #

Patch Set 10 : Rebasing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+226 lines, -46 lines) Patch
M mojo/go/go.py View 1 2 3 4 5 6 7 2 chunks +11 lines, -45 lines 0 comments Download
A mojo/tools/data/gotests View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -0 lines 0 comments Download
M mojo/tools/get_test_list.py View 1 2 3 4 5 1 chunk +9 lines, -1 line 0 comments Download
A mojo/tools/mopy/invoke_go.py View 1 2 3 4 5 6 7 8 1 chunk +106 lines, -0 lines 0 comments Download
M mojo/tools/mopy/paths.py View 1 2 3 4 5 6 7 1 chunk +10 lines, -0 lines 0 comments Download
A mojo/tools/run_pure_go_tests.py View 1 2 3 4 5 6 7 1 chunk +49 lines, -0 lines 0 comments Download
A mojom/mojom_parser/lexer/lexer_test.go View 1 2 3 4 5 6 7 1 chunk +15 lines, -0 lines 0 comments Download
A mojom/mojom_parser/parser/parser_test.go View 1 2 3 4 5 6 7 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 45 (21 generated)
rudominer
Hi Przemek, Please take a look. thanks, Mitch
5 years, 2 months ago (2015-10-05 05:13:58 UTC) #2
rudominer
FYI, the first in a series of CLs for the new Mojom parser in Go ...
5 years, 2 months ago (2015-10-05 20:40:32 UTC) #3
ppi
https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py File mojo/tools/get_test_list.py (right): https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py#newcode121 mojo/tools/get_test_list.py:121: # Go system tests Please end comment with ":" ...
5 years, 2 months ago (2015-10-05 21:49:58 UTC) #4
rudominer
Thanks for the thorough review Przemek. ptal. https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py File mojo/tools/get_test_list.py (right): https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py#newcode121 mojo/tools/get_test_list.py:121: # Go ...
5 years, 2 months ago (2015-10-05 23:08:13 UTC) #5
viettrungluu
https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py File mojo/tools/get_test_list.py (right): https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py#newcode126 mojo/tools/get_test_list.py:126: if 'go_build_tool' in config.values: Apparently, in this file, we ...
5 years, 2 months ago (2015-10-05 23:10:39 UTC) #7
rudominer
Sorry I missed something and the build is failing. One moment....
5 years, 2 months ago (2015-10-05 23:11:48 UTC) #8
viettrungluu
https://codereview.chromium.org/1384243002/diff/20001/mojo/tools/run_pure_go_tests.py File mojo/tools/run_pure_go_tests.py (right): https://codereview.chromium.org/1384243002/diff/20001/mojo/tools/run_pure_go_tests.py#newcode2 mojo/tools/run_pure_go_tests.py:2: # Copyright (c) 2015 The Chromium Authors. All rights ...
5 years, 2 months ago (2015-10-05 23:16:59 UTC) #9
rudominer
Przemek: I responded to your comments. ptal. Trung: I responded to most of your comments ...
5 years, 2 months ago (2015-10-06 00:29:10 UTC) #13
viettrungluu
https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py File mojo/tools/get_test_list.py (right): https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py#newcode129 mojo/tools/get_test_list.py:129: go_tool = os.path.join(Paths().src_root, 'third_party', 'go', 'tool', On 2015/10/06 00:29:10, ...
5 years, 2 months ago (2015-10-06 01:46:30 UTC) #14
ppi
https://codereview.chromium.org/1384243002/diff/60001/mojo/tools/run_pure_go_tests.py File mojo/tools/run_pure_go_tests.py (right): https://codereview.chromium.org/1384243002/diff/60001/mojo/tools/run_pure_go_tests.py#newcode30 mojo/tools/run_pure_go_tests.py:30: # NOTE(rudominer) The paths should all be made absolute ...
5 years, 2 months ago (2015-10-06 17:57:47 UTC) #15
rudominer
ptal https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py File mojo/tools/get_test_list.py (right): https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py#newcode129 mojo/tools/get_test_list.py:129: go_tool = os.path.join(Paths().src_root, 'third_party', 'go', 'tool', On 2015/10/06 ...
5 years, 2 months ago (2015-10-06 20:28:54 UTC) #20
ppi
https://codereview.chromium.org/1384243002/diff/200001/mojo/tools/get_test_list.py File mojo/tools/get_test_list.py (right): https://codereview.chromium.org/1384243002/diff/200001/mojo/tools/get_test_list.py#newcode133 mojo/tools/get_test_list.py:133: "linux_amd64", "bin", "go") I think we want two more ...
5 years, 2 months ago (2015-10-06 20:33:27 UTC) #21
rudominer
ptal https://codereview.chromium.org/1384243002/diff/200001/mojo/tools/get_test_list.py File mojo/tools/get_test_list.py (right): https://codereview.chromium.org/1384243002/diff/200001/mojo/tools/get_test_list.py#newcode133 mojo/tools/get_test_list.py:133: "linux_amd64", "bin", "go") On 2015/10/06 20:33:27, ppi wrote: ...
5 years, 2 months ago (2015-10-06 20:52:41 UTC) #22
ppi
lgtm
5 years, 2 months ago (2015-10-06 21:01:50 UTC) #23
viettrungluu
not lgtm https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py File mojo/tools/get_test_list.py (right): https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py#newcode129 mojo/tools/get_test_list.py:129: go_tool = os.path.join(Paths().src_root, 'third_party', 'go', 'tool', On ...
5 years, 2 months ago (2015-10-06 21:03:44 UTC) #24
viettrungluu
https://codereview.chromium.org/1384243002/diff/220001/mojo/tools/get_test_list.py File mojo/tools/get_test_list.py (right): https://codereview.chromium.org/1384243002/diff/220001/mojo/tools/get_test_list.py#newcode132 mojo/tools/get_test_list.py:132: go_tool = os.path.join(Paths().src_root, "third_party", "go", "tool", In particular, if ...
5 years, 2 months ago (2015-10-06 21:06:28 UTC) #25
viettrungluu
https://codereview.chromium.org/1384243002/diff/60001/mojo/tools/run_pure_go_tests.py File mojo/tools/run_pure_go_tests.py (right): https://codereview.chromium.org/1384243002/diff/60001/mojo/tools/run_pure_go_tests.py#newcode22 mojo/tools/run_pure_go_tests.py:22: env['GOROOT'] = os.path.dirname(os.path.dirname(go_tool)) On 2015/10/06 01:46:30, viettrungluu wrote: > ...
5 years, 2 months ago (2015-10-06 21:08:06 UTC) #26
rudominer
ptal https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py File mojo/tools/get_test_list.py (right): https://codereview.chromium.org/1384243002/diff/1/mojo/tools/get_test_list.py#newcode129 mojo/tools/get_test_list.py:129: go_tool = os.path.join(Paths().src_root, 'third_party', 'go', 'tool', On 2015/10/06 ...
5 years, 2 months ago (2015-10-09 18:30:30 UTC) #36
rudominer
I added a couple of dummy tests in order to test the new testing infrastructure. ...
5 years, 2 months ago (2015-10-09 19:21:24 UTC) #38
viettrungluu
https://codereview.chromium.org/1384243002/diff/460001/mojo/go/go.py File mojo/go/go.py (right): https://codereview.chromium.org/1384243002/diff/460001/mojo/go/go.py#newcode64 mojo/go/go.py:64: def InvokeGo(go_tool, go_options, work_dir=None, src_root=None, Probably this should be ...
5 years, 2 months ago (2015-10-09 21:39:50 UTC) #39
rudominer
ptal. I'm not sure what's up with the test failures but I'm pretty sure it ...
5 years, 2 months ago (2015-10-09 23:42:07 UTC) #42
rudominer
Tests are green now except one device status check for Android.
5 years, 2 months ago (2015-10-10 15:52:49 UTC) #43
viettrungluu
Thanks, lgtm.
5 years, 2 months ago (2015-10-12 16:56:42 UTC) #44
rudominer
5 years, 2 months ago (2015-10-12 18:12:45 UTC) #45
Message was sent while issue was closed.
Committed patchset #10 (id:560001) manually as
5bb65cc1b4f88ee8b26300301a4eda118a134457 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698