mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-05 02:59:44 -06:00
Make tests resilient to windows file paths
This commit is contained in:
@@ -58,22 +58,21 @@ var BackupsSystemTableQueries = queries.ScriptTest{
|
||||
SetUpScript: []string{
|
||||
`call dolt_backup("add", "backup3", "file:///tmp/backup3");`,
|
||||
`call dolt_backup("add", "backup1", "file:///tmp/backup1");`,
|
||||
`call dolt_backup("add", "backup2", "file:///tmp/backup2");`,
|
||||
`call dolt_backup("add", "backup2", "aws://[ddb_table:ddb_s3_bucket]/db1");`,
|
||||
},
|
||||
Assertions: []queries.ScriptTestAssertion{
|
||||
{
|
||||
Query: "select * from dolt_backups;",
|
||||
// Query for just the names because on Windows the Drive letter is inserted into the file path
|
||||
Query: "select name from dolt_backups;",
|
||||
Expected: []sql.Row{
|
||||
{"backup1", "file:///tmp/backup1"},
|
||||
{"backup2", "file:///tmp/backup2"},
|
||||
{"backup3", "file:///tmp/backup3"},
|
||||
{"backup1"},
|
||||
{"backup2"},
|
||||
{"backup3"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Query: "select url from dolt_backups where name = 'backup1';",
|
||||
Expected: []sql.Row{
|
||||
{"file:///tmp/backup1"},
|
||||
},
|
||||
Query: "select url from dolt_backups where name = 'backup2';",
|
||||
Expected: []sql.Row{{"aws://[ddb_table:ddb_s3_bucket]/db1"}},
|
||||
},
|
||||
{
|
||||
Query: "delete from dolt_backups where name = 'backup1';",
|
||||
@@ -84,11 +83,11 @@ var BackupsSystemTableQueries = queries.ScriptTest{
|
||||
ExpectedErrStr: "table doesn't support UPDATE",
|
||||
},
|
||||
{
|
||||
Query: "insert into dolt_backups values ('backup4', 'file:///tmp/backup4');",
|
||||
Query: "insert into dolt_backups values ('backup4', 'file:///tmp/broken');", // nolint: gas
|
||||
ExpectedErrStr: "table doesn't support INSERT INTO",
|
||||
},
|
||||
{
|
||||
Query: "call dolt_backup('add', 'backup4', 'file:///tmp/backup4');",
|
||||
Query: "call dolt_backup('add', 'backup4', 'aws://[ddb_table_4:ddb_s3_bucket_4]/db1');",
|
||||
Expected: []sql.Row{{0}},
|
||||
},
|
||||
{
|
||||
@@ -96,11 +95,10 @@ var BackupsSystemTableQueries = queries.ScriptTest{
|
||||
Expected: []sql.Row{{0}},
|
||||
},
|
||||
{
|
||||
Query: "select * from dolt_backups;",
|
||||
Query: "select * from dolt_backups where url like 'aws://%'",
|
||||
Expected: []sql.Row{
|
||||
{"backup2", "file:///tmp/backup2"},
|
||||
{"backup3", "file:///tmp/backup3"},
|
||||
{"backup4", "file:///tmp/backup4"},
|
||||
{"backup2", "aws://[ddb_table:ddb_s3_bucket]/db1"},
|
||||
{"backup4", "aws://[ddb_table_4:ddb_s3_bucket_4]/db1"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user