New issue
Advanced search Search tips

Issue 782265 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Nov 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Feature



Sign in to add a comment

tast should provide a way to list tests

Project Member Reported by derat@chromium.org, Nov 7 2017

Issue description

The tast command doesn't currently have any knowledge about which tests are available (and in the case of local tests, the tests live on a remote DUT that may include an older snapshot of the tests).

I should add a way (probably via either a new "list" subcommand or a "-list" flag on the "run" subcommand) to get a list of tests from the test executable. It'd be nice if there were some other flag ("-details"?) to print test descriptions, timeouts, etc., since those are now passed back to tast ( issue 773819 ).

This has a lot of overlap with the code in cmd/run, so it probably make sense to share as much of it as possible.
 

Comment 1 by derat@chromium.org, Nov 16 2017

Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast/+/87d8f30e92490a2e23d3a7a1351c4b38cd92edc3

commit 87d8f30e92490a2e23d3a7a1351c4b38cd92edc3
Author: Daniel Erat <derat@chromium.org>
Date: Tue Nov 28 21:34:28 2017

tast: Refactor SSH test code.

Move some SSH-key-generating functionality into the
common/host/test package so it can be used by other packages
that need to start a test SSH server.

Also update common/host/test.SSHServer to support returning
canned responses for particular commands instead of actually
executing them.

Per the "Interfaces" section of
https://github.com/golang/go/wiki/CodeReviewComments, this
is the preferred approach for testing in Go: rather than
giving the package's users e.g. a FakeHost implementation
of a Host interface, make it easier for them to use the real
SSH implementation in their tests.

BUG= chromium:782265 
TEST=tests still pass

Change-Id: I31718271d29d58a76110fc7f0401c9cbbdf01aa9
Reviewed-on: https://chromium-review.googlesource.com/792602
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[add] https://crrev.com/87d8f30e92490a2e23d3a7a1351c4b38cd92edc3/src/chromiumos/tast/common/host/test/ssh_keys.go
[modify] https://crrev.com/87d8f30e92490a2e23d3a7a1351c4b38cd92edc3/src/chromiumos/tast/common/host/test/ssh_server.go
[modify] https://crrev.com/87d8f30e92490a2e23d3a7a1351c4b38cd92edc3/src/chromiumos/tast/common/host/ssh_test.go

Project Member

Comment 3 by bugdroid1@chromium.org, Nov 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast/+/49fcb03d53110981091aa3bc4ea73432e627a345

commit 49fcb03d53110981091aa3bc4ea73432e627a345
Author: Daniel Erat <derat@chromium.org>
Date: Wed Nov 29 14:09:59 2017

tast: Add tests for run.Local.

Add rudimentary tests for the chromiumos/tast/cmd/run
package's Local function. Building and pushing isn't
exercised, but the tests verify that SSH connections are
established and that output from the test executable is
interpreted correctly.

BUG= chromium:782265 
TEST=tests pass

Change-Id: I37aa6b4bf22ff7d60801de284335be39763ad169
Reviewed-on: https://chromium-review.googlesource.com/795215
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[add] https://crrev.com/49fcb03d53110981091aa3bc4ea73432e627a345/src/chromiumos/tast/cmd/run/local_test.go

Project Member

Comment 4 by bugdroid1@chromium.org, Nov 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/f93a6b0dd46dabe5cf7bf6670b2472bc9a408ea5

commit f93a6b0dd46dabe5cf7bf6670b2472bc9a408ea5
Author: Daniel Erat <derat@chromium.org>
Date: Thu Nov 30 17:17:25 2017

tast-tests: Add -listtests flag to test executables.

Make both local_tests and remote_tests expose a -listtests
flag that instructs them to print the JSON serialization of
matching tests to stdout and then exit without running
anything.

BUG= chromium:782265 
TEST=tests are printed when used with "tast list" command
CQ-DEPEND=I5730d7fbec1c1af79cae685d1fa7d2b3c66f1935

Change-Id: Iadbaac0b08c590626ac2ed980afb09453c95cce5
Reviewed-on: https://chromium-review.googlesource.com/798793
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/f93a6b0dd46dabe5cf7bf6670b2472bc9a408ea5/src/chromiumos/tast/remote/main.go
[modify] https://crrev.com/f93a6b0dd46dabe5cf7bf6670b2472bc9a408ea5/src/chromiumos/tast/local/main.go

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast/+/8800668d8371705a72281181d6101d63efa08a23

commit 8800668d8371705a72281181d6101d63efa08a23
Author: Daniel Erat <derat@chromium.org>
Date: Thu Nov 30 17:17:25 2017

tast: Add "list" subcommand to tast command.

Add a "list" subcommand to the tast command that can be used
to list the tests that would be run instead of actually
running them.

BUG= chromium:782265 
TEST=added unit tests; also verified that "tast list" works
     with both --type=local and --type=remote
CQ-DEPEND=Iadbaac0b08c590626ac2ed980afb09453c95cce5

Change-Id: I5730d7fbec1c1af79cae685d1fa7d2b3c66f1935
Reviewed-on: https://chromium-review.googlesource.com/798794
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/8800668d8371705a72281181d6101d63efa08a23/src/chromiumos/tast/cmd/run_cmd.go
[modify] https://crrev.com/8800668d8371705a72281181d6101d63efa08a23/src/chromiumos/tast/cmd/run/local.go
[modify] https://crrev.com/8800668d8371705a72281181d6101d63efa08a23/src/chromiumos/tast/cmd/run/remote.go
[modify] https://crrev.com/8800668d8371705a72281181d6101d63efa08a23/src/chromiumos/tast/cmd/run/local_test.go
[modify] https://crrev.com/8800668d8371705a72281181d6101d63efa08a23/src/chromiumos/tast/cmd/main.go
[modify] https://crrev.com/8800668d8371705a72281181d6101d63efa08a23/src/chromiumos/tast/cmd/run/config.go
[modify] https://crrev.com/8800668d8371705a72281181d6101d63efa08a23/src/chromiumos/tast/common/runner/runner.go
[add] https://crrev.com/8800668d8371705a72281181d6101d63efa08a23/src/chromiumos/tast/cmd/list_cmd.go
[add] https://crrev.com/8800668d8371705a72281181d6101d63efa08a23/src/chromiumos/tast/cmd/run/print.go

Comment 6 by derat@chromium.org, Nov 30 2017

Status: Verified (was: Started)

Comment 7 by derat@chromium.org, Jan 23 2018

Components: Tests>Tast

Sign in to add a comment