Skip to content

Commit

Permalink
Change verifier to only run read-only queries by default
Browse files Browse the repository at this point in the history
Running write or destructive queries is dangerous, so make it opt-in
  • Loading branch information
cberner committed Apr 18, 2016
1 parent 737ba20 commit 1011879
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
import java.util.Set;
import java.util.concurrent.TimeUnit;

import static com.facebook.presto.verifier.QueryType.CREATE;
import static com.facebook.presto.verifier.QueryType.MODIFY;
import static com.facebook.presto.verifier.QueryType.READ;
import static java.util.Objects.requireNonNull;

Expand All @@ -43,8 +41,8 @@ public class VerifierConfig
private String testPasswordOverride;
private String controlPasswordOverride;
private List<String> suites;
private Set<QueryType> controlQueryTypes = ImmutableSet.of(CREATE, READ, MODIFY);
private Set<QueryType> testQueryTypes = ImmutableSet.of(CREATE, READ, MODIFY);
private Set<QueryType> controlQueryTypes = ImmutableSet.of(READ);
private Set<QueryType> testQueryTypes = ImmutableSet.of(READ);
private String source;
private String runId = new DateTime().toString("yyyy-MM-dd");
private Set<String> eventClients = ImmutableSet.of("human-readable");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public void testDefaults()
.setControlPasswordOverride(null)
.setSuite(null)
.setSuites(null)
.setControlQueryTypes(Joiner.on(",").join(CREATE, READ, MODIFY))
.setTestQueryTypes(Joiner.on(",").join(CREATE, READ, MODIFY))
.setControlQueryTypes(READ.name())
.setTestQueryTypes(READ.name())
.setSource(null)
.setRunId(new DateTime().toString("yyyy-MM-dd"))
.setEventClients("human-readable")
Expand Down Expand Up @@ -82,7 +82,7 @@ public void testExplicitPropertyMappings()
Map<String, String> properties = new ImmutableMap.Builder<String, String>()
.put("suites", "my_suite")
.put("suite", "my_suite")
.put("control.query-types", READ.name())
.put("control.query-types", Joiner.on(",").join(CREATE, READ))
.put("test.query-types", MODIFY.name())
.put("source", "my_source")
.put("run-id", "my_run_id")
Expand Down Expand Up @@ -126,7 +126,7 @@ public void testExplicitPropertyMappings()
VerifierConfig expected = new VerifierConfig().setTestUsernameOverride("verifier-test")
.setSuites("my_suite")
.setSuite("my_suite")
.setControlQueryTypes(READ.name())
.setControlQueryTypes(Joiner.on(",").join(CREATE, READ))
.setTestQueryTypes(MODIFY.name())
.setSource("my_source")
.setRunId("my_run_id")
Expand Down

0 comments on commit 1011879

Please sign in to comment.