-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement reference sub-command. Add sakila files for testing
Signed-off-by: Rohit Nayak <[email protected]>
- Loading branch information
1 parent
997dff3
commit 7e87241
Showing
8 changed files
with
47,732 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package reference | ||
|
||
import ( | ||
"github.com/stretchr/testify/require" | ||
"github.com/vitessio/vt/go/data" | ||
"testing" | ||
) | ||
|
||
func TestReference(t *testing.T) { | ||
cfg := Config{ | ||
FileName: "../../t/sakila/sakila.test", | ||
Loader: data.SQLScriptLoader{}, | ||
} | ||
|
||
ri, err := Find(cfg) | ||
require.NoError(t, err) | ||
require.NotNil(t, ri) | ||
require.NotEmpty(t, ri.TableSummaries) | ||
validReferenceTables := []string{"actor", "address", "category", "city", "country", "film", "language", "staff"} | ||
for _, table := range ri.ChosenTables { | ||
require.Containsf(t, validReferenceTables, table, "table %s is not a valid reference table", table) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.