Skip to content

Commit

Permalink
Add test.go exclusion flag to sharded tests as well
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsonja committed Jul 2, 2016
1 parent d3e3b95 commit b94d79f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ script:
# Log GOMAXPROCS (should be 2 as of 07/2015).
- go run travis/log_gomaxprocs.go
- |
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
if [[ $TRAVIS_PULL_REQUEST = "false" ]]; then
go run test.go $TEST_FLAGS $TEST_MATRIX
else
# Exclude webdriver tests on Travis PRs since the sauce addon does not work for PRs
Expand Down
4 changes: 2 additions & 2 deletions test.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,12 +748,13 @@ func getTestsSorted(names []string, testMap map[string]*Test) []*Test {

func selectedTests(args []string, config *Config) []*Test {
var tests []*Test
excluded_tests := strings.Split(*exclude, ",")
if *shard >= 0 {
// Run the tests in a given shard.
// This can be combined with positional args.
var names []string
for name, t := range config.Tests {
if t.Shard == *shard {
if t.Shard == *shard && (*exclude == "" || !t.hasAnyTag(excluded_tests)) {
t.name = name
names = append(names, name)
}
Expand All @@ -774,7 +775,6 @@ func selectedTests(args []string, config *Config) []*Test {
if len(args) == 0 && *shard < 0 {
// Run all tests.
var names []string
excluded_tests := strings.Split(*exclude, ",")
for name, t := range config.Tests {
if !t.Manual && (*tag == "" || t.hasTag(*tag)) && (*exclude == "" || !t.hasAnyTag(excluded_tests)) {
names = append(names, name)
Expand Down

0 comments on commit b94d79f

Please sign in to comment.