mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-29 19:10:13 -06:00
Simpler. Much better structure for lots of tests which test things like connection strings, users and passwords provided at connection time, etc.
278 lines
8.0 KiB
YAML
278 lines
8.0 KiB
YAML
tests:
|
|
- name: persist global variable before server startup
|
|
repos:
|
|
- name: repo1
|
|
with_files:
|
|
- name: ".dolt/config.json"
|
|
contents: |
|
|
{"sqlserver.global.max_connections":"1000"}
|
|
server:
|
|
args: ["-l", "trace"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["1000"]]
|
|
- name: invalid persisted global variable name throws warning on server startup, but does not crash
|
|
repos:
|
|
- name: repo1
|
|
with_files:
|
|
- name: ".dolt/config.json"
|
|
contents: |
|
|
{"sqlserver.global.unknown":"1000"}
|
|
server:
|
|
args: ["-l", "trace"]
|
|
log_matches:
|
|
- "warning: persisted system variable unknown was not loaded since its definition does not exist."
|
|
connections:
|
|
- on: repo1
|
|
- name: invalid persisted global variable value throws warning on server startup, but does not crash
|
|
repos:
|
|
- name: repo1
|
|
with_files:
|
|
- name: ".dolt/config.json"
|
|
contents: |
|
|
{"sqlserver.global.max_connections":"string"}
|
|
server:
|
|
log_matches:
|
|
- "error: failed to load persisted global variables: key: 'max_connections'; strconv.ParseInt: parsing \"string\": invalid syntax"
|
|
connections:
|
|
- on: repo1
|
|
- name: persisted global variable in server
|
|
repos:
|
|
- name: repo1
|
|
server:
|
|
args: ["-l", "trace"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- exec: "SET @@PERSIST.max_connections = 1000"
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["1000"]]
|
|
restart_server: {}
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["1000"]]
|
|
- name: dolt_replicate_heads is global variable
|
|
repos:
|
|
- name: repo1
|
|
server:
|
|
args: ["-l", "trace"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- exec: "SET @@GLOBAL.dolt_replicate_heads = main"
|
|
- query: "select @@GLOBAL.dolt_replicate_heads"
|
|
result:
|
|
columns: ["@@GLOBAL.dolt_replicate_heads"]
|
|
rows: [["main"]]
|
|
- query: "select @@SESSION.dolt_replicate_heads"
|
|
result:
|
|
columns: ["@@SESSION.dolt_replicate_heads"]
|
|
# XXX: Is this OK? The session variable does not see the new global value; only new connections see it.
|
|
rows: [[""]]
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@SESSION.dolt_replicate_heads"
|
|
result:
|
|
columns: ["@@SESSION.dolt_replicate_heads"]
|
|
rows: [["main"]]
|
|
- query: "select @@dolt_replicate_heads"
|
|
result:
|
|
columns: ["@@SESSION.dolt_replicate_heads"]
|
|
rows: [["main"]]
|
|
- name: dolt_replicate_all_heads is global variable
|
|
repos:
|
|
- name: repo1
|
|
server:
|
|
args: ["-l", "trace"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- exec: "SET @@GLOBAL.dolt_replicate_all_heads = 1"
|
|
- query: "select @@GLOBAL.dolt_replicate_all_heads"
|
|
result:
|
|
columns: ["@@GLOBAL.dolt_replicate_all_heads"]
|
|
rows: [["1"]]
|
|
- query: "select @@SESSION.dolt_replicate_all_heads"
|
|
result:
|
|
columns: ["@@SESSION.dolt_replicate_all_heads"]
|
|
# XXX: Is this OK? The session variable does not see the new global value; only new connections see it.
|
|
rows: [["0"]]
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@SESSION.dolt_replicate_all_heads"
|
|
result:
|
|
columns: ["@@SESSION.dolt_replicate_all_heads"]
|
|
rows: [["1"]]
|
|
- query: "select @@dolt_replicate_all_heads"
|
|
result:
|
|
columns: ["@@SESSION.dolt_replicate_all_heads"]
|
|
rows: [["1"]]
|
|
- name: dolt_transaction_commit is global variable
|
|
repos:
|
|
- name: repo1
|
|
server:
|
|
args: ["-l", "trace"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- exec: "SET @@GLOBAL.dolt_transaction_commit = 1"
|
|
- query: "select @@GLOBAL.dolt_transaction_commit"
|
|
result:
|
|
columns: ["@@GLOBAL.dolt_transaction_commit"]
|
|
rows: [["1"]]
|
|
- query: "select @@SESSION.dolt_transaction_commit"
|
|
result:
|
|
columns: ["@@SESSION.dolt_transaction_commit"]
|
|
# XXX: Is this OK? The session variable does not see the new global value; only new connections see it.
|
|
rows: [["0"]]
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@SESSION.dolt_transaction_commit"
|
|
result:
|
|
columns: ["@@SESSION.dolt_transaction_commit"]
|
|
rows: [["1"]]
|
|
- query: "select @@dolt_transaction_commit"
|
|
result:
|
|
columns: ["@@SESSION.dolt_transaction_commit"]
|
|
rows: [["1"]]
|
|
- query: "select count(*) from dolt_log"
|
|
result:
|
|
columns: ["count(*)"]
|
|
rows: [["1"]]
|
|
- exec: "create table tmp (i int)"
|
|
- query: "select count(*) from dolt_log"
|
|
result:
|
|
columns: ["count(*)"]
|
|
rows: [["2"]]
|
|
- name: persist only global variable during server session
|
|
repos:
|
|
- name: repo1
|
|
server:
|
|
args: ["-l", "trace"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- exec: "SET PERSIST max_connections = 1000"
|
|
- exec: "SET PERSIST_ONLY max_connections = 7777"
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["1000"]]
|
|
restart_server: {}
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["7777"]]
|
|
- name: persist invalid global variable name during server session
|
|
repos:
|
|
- name: repo1
|
|
server:
|
|
args: ["-l", "trace"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- exec: "SET @@PERSIST.unknown = 1000"
|
|
error_match: "Unknown system variable"
|
|
- name: persist invalid global variable value during server session
|
|
repos:
|
|
- name: repo1
|
|
server: {}
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- exec: "SET @@PERSIST.max_connections = 'string'"
|
|
error_match: "Variable 'max_connections' can't be set to the value of 'string'"
|
|
- name: set max_connections with yaml config
|
|
repos:
|
|
- name: repo1
|
|
with_files:
|
|
- name: "server.yaml"
|
|
contents: |
|
|
log_level: trace
|
|
listener:
|
|
max_connections: 999
|
|
server:
|
|
args: ["--config", "server.yaml"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["999"]]
|
|
- name: persistence behavior set to load
|
|
repos:
|
|
- name: repo1
|
|
server:
|
|
args: ["--persistence-behavior", "load"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["151"]]
|
|
- name: persistence behavior set to ignore
|
|
repos:
|
|
- name: repo1
|
|
server:
|
|
args: ["--persistence-behavior", "ignore"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["100"]]
|
|
- name: persisted global variable defined on the command line
|
|
repos:
|
|
- name: repo1
|
|
server:
|
|
args: ["--max-connections", "555"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["555"]]
|
|
- name: persist global variable before server startup with persistence behavior with ignore
|
|
repos:
|
|
- name: repo1
|
|
with_files:
|
|
- name: ".dolt/config.json"
|
|
contents: |
|
|
{"sqlserver.global.max_connections":"999"}
|
|
server:
|
|
args: ["--persistence-behavior", "ignore"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["100"]]
|
|
- name: persisted global variable defined on the command line with persistence ignored
|
|
repos:
|
|
- name: repo1
|
|
server:
|
|
args: ["--max-connections", "555", "--persistence-behavior", "ignore"]
|
|
connections:
|
|
- on: repo1
|
|
queries:
|
|
- query: "select @@GLOBAL.max_connections"
|
|
result:
|
|
columns: ["@@GLOBAL.max_connections"]
|
|
rows: [["555"]]
|