[testsharder] Revert change that fails for invalid multipliers.

Different builders can create different lists of tests to run, so we
cannot expect the targets in the multipliers to exist in the tests.json
file for all the builders running in CQ for a CL. Thus, the builders
that have those targets will properly create the new shards and execute them, but
the ones that don't will fail for invalid multipliers, which we don't
want.

Change-Id: I57af41e52a3f5335bce8285b0f30387c94417f6d
diff --git a/cmd/testsharder/main.go b/cmd/testsharder/main.go
index c715cdb..adbec03 100644
--- a/cmd/testsharder/main.go
+++ b/cmd/testsharder/main.go
@@ -81,10 +81,7 @@
 		if err != nil {
 			log.Fatal(err)
 		}
-		shards, err = testsharder.MultiplyShards(shards, multipliers)
-		if err != nil {
-			log.Fatal(err)
-		}
+		shards = testsharder.MultiplyShards(shards, multipliers)
 	}
 	shards = testsharder.WithMaxSize(shards, maxShardSize)
 	f := os.Stdout
diff --git a/testsharder/shard.go b/testsharder/shard.go
index b92f5ff..f5f5532 100644
--- a/testsharder/shard.go
+++ b/testsharder/shard.go
@@ -76,8 +76,7 @@
 
 // MultiplyShards appends new shards to shards where each new shard contains one test
 // repeated multiple times according to the specifications in multipliers.
-func MultiplyShards(shards []*Shard, multipliers []TestModifier) ([]*Shard, error) {
-	multipliersFound := make(map[TestModifier]bool)
+func MultiplyShards(shards []*Shard, multipliers []TestModifier) []*Shard {
 	for _, shard := range shards {
 		for _, multiplier := range multipliers {
 			for _, test := range shard.Tests {
@@ -87,15 +86,11 @@
 						Tests: multiplyTest(test, multiplier.TotalRuns),
 						Env:   shard.Env,
 					})
-					multipliersFound[multiplier] = true
 				}
 			}
 		}
 	}
-	if len(multipliersFound) != len(multipliers) {
-		return nil, fmt.Errorf("Not all of the multiplier targets were found in the test manifest. Make sure the targets appear in $root_build_dir/tests.json")
-	}
-	return shards, nil
+	return shards
 }
 
 func min(a, b int) int {
@@ -106,7 +101,7 @@
 }
 
 func divRoundUp(a, b int) int {
-	if a % b == 0 {
+	if a%b == 0 {
 		return a / b
 	}
 	return (a / b) + 1
diff --git a/testsharder/shard_test.go b/testsharder/shard_test.go
index 9c5545e..2185c5d 100644
--- a/testsharder/shard_test.go
+++ b/testsharder/shard_test.go
@@ -243,13 +243,10 @@
 			makeTestModifier(1, Fuchsia, 2),
 			makeTestModifier(3, Linux, 3),
 		}
-		actual, err := MultiplyShards(
+		actual := MultiplyShards(
 			shards,
 			multipliers,
 		)
-		if err != nil {
-			t.Fatalf("failed with errmsg: %v", err)
-		}
 		expected := append(
 			shards,
 			multShard(env1, Fuchsia, 1, 2),
@@ -258,25 +255,6 @@
 		)
 		assertEqual(t, expected, actual)
 	})
-
-	t.Run("fail to multiply shards with invalid multipliers", func(t *testing.T) {
-		shards := []*Shard{
-			shard(env1, Fuchsia, 1),
-			shard(env2, Fuchsia, 1, 2),
-			shard(env3, Linux, 3),
-		}
-		multipliers := []TestModifier{
-			makeTestModifier(1, Linux, 2),
-			makeTestModifier(3, Linux, 3),
-		}
-		_, err := MultiplyShards(
-			shards,
-			multipliers,
-		)
-		if err == nil {
-			t.Fatalf("did not fail for invalid multipliers")
-		}
-	})
 }
 
 func max(a, b int) int {