1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Integration testing: Standardize "empty" usage (#612)

* All tests start with an "empty", not end.
* "empty" formatted the same way for all tests.
This commit is contained in:
Tom Limoncelli
2020-01-30 10:05:37 -05:00
committed by GitHub
parent 36a05608e0
commit e172df2817

View File

@ -526,7 +526,6 @@ func makeTests(t *testing.T) []*TestCase {
// Case // Case
tests = append(tests, tc("Empty"), tests = append(tests, tc("Empty"),
tc("Empty"),
tc("Create CAPS", mx("BAR", 5, "BAR.com.")), tc("Create CAPS", mx("BAR", 5, "BAR.com.")),
tc("Downcase label", mx("bar", 5, "BAR.com."), a("decoy", "1.1.1.1")), tc("Downcase label", mx("bar", 5, "BAR.com."), a("decoy", "1.1.1.1")),
tc("Downcase target", mx("bar", 5, "bar.com."), a("decoy", "2.2.2.2")), tc("Downcase target", mx("bar", 5, "bar.com."), a("decoy", "2.2.2.2")),
@ -556,7 +555,6 @@ func makeTests(t *testing.T) []*TestCase {
// TXT (single) // TXT (single)
tests = append(tests, tc("Empty"), tests = append(tests, tc("Empty"),
tc("Empty"),
tc("Create a TXT", txt("foo", "simple")), tc("Create a TXT", txt("foo", "simple")),
tc("Change a TXT", txt("foo", "changed")), tc("Change a TXT", txt("foo", "changed")),
tc("Empty"), tc("Empty"),
@ -578,8 +576,7 @@ func makeTests(t *testing.T) []*TestCase {
if !providers.ProviderHasCapability(*providerToRun, providers.CanUseTXTMulti) { if !providers.ProviderHasCapability(*providerToRun, providers.CanUseTXTMulti) {
t.Log("Skipping TXTMulti Tests because provider does not support them") t.Log("Skipping TXTMulti Tests because provider does not support them")
} else { } else {
tests = append(tests, tests = append(tests, tc("Empty"),
tc("Empty"),
tc("Create TXTMulti 1", tc("Create TXTMulti 1",
txtmulti("foo1", []string{"simple"}), txtmulti("foo1", []string{"simple"}),
), ),
@ -606,19 +603,16 @@ func makeTests(t *testing.T) []*TestCase {
tc("3x255-byte TXTMulti", tc("3x255-byte TXTMulti",
txt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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY", "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"}),
), ),
tc("Empty"),
) )
} }
// ignored records // ignored records
tests = append(tests, tests = append(tests, tc("Empty"),
tc("Empty"),
tc("Create some records", txt("foo", "simple"), a("foo", "1.2.3.4")), tc("Create some records", txt("foo", "simple"), a("foo", "1.2.3.4")),
tc("Add a new record - ignoring foo", a("bar", "1.2.3.4"), ignore("foo")), tc("Add a new record - ignoring foo", a("bar", "1.2.3.4"), ignore("foo")),
) )
tests = append(tests, tests = append(tests, tc("Empty"),
tc("Empty"),
tc("Create some records", txt("bar.foo", "simple"), a("bar.foo", "1.2.3.4")), tc("Create some records", txt("bar.foo", "simple"), a("bar.foo", "1.2.3.4")),
tc("Add a new record - ignoring *.foo", a("bar", "1.2.3.4"), ignore("*.foo")), tc("Add a new record - ignoring *.foo", a("bar", "1.2.3.4"), ignore("*.foo")),
) )
@ -636,13 +630,12 @@ func makeTests(t *testing.T) []*TestCase {
// test r53 for very very large batch sizes // test r53 for very very large batch sizes
if *providerToRun == "ROUTE53" { if *providerToRun == "ROUTE53" {
tests = append(tests, tests = append(tests, tc("Empty"),
tc("600 records", manyA("rec%04d", "1.2.3.4", 600)...), tc("600 records", manyA("rec%04d", "1.2.3.4", 600)...),
tc("Update 600 records", manyA("rec%04d", "1.2.3.5", 600)...), tc("Update 600 records", manyA("rec%04d", "1.2.3.5", 600)...),
tc("Empty"), tc("Empty"),
tc("1200 records", manyA("rec%04d", "1.2.3.4", 1200)...), tc("1200 records", manyA("rec%04d", "1.2.3.4", 1200)...),
tc("Update 1200 records", manyA("rec%04d", "1.2.3.5", 1200)...), tc("Update 1200 records", manyA("rec%04d", "1.2.3.5", 1200)...),
tc("Empty"),
) )
} }