Skip to content

Commit

Permalink
Testdata path arg
Browse files Browse the repository at this point in the history
  • Loading branch information
tbantle22 committed Jul 10, 2023
1 parent 53264ff commit c747d6c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ teardown() {
}

@test "node mysql client, hosted workbench stability" {
node $BATS_TEST_DIRNAME/node/workbench.js $USER $PORT $REPO_NAME
node $BATS_TEST_DIRNAME/node/workbench.js $USER $PORT $REPO_NAME $BATS_TEST_DIRNAME/node/testdata
}

@test "c mysql connector" {
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/mysql-client-tests/node/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ source ../helpers.bash
echo "Running $1 tests"
setup_dolt_repo
cd ..
node $1 $USER $PORT $REPO_NAME
node $1 $USER $PORT $REPO_NAME $PWD/testdata
teardown_dolt_repo
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import { tagsTests } from "./tags.js";
import { viewsTests } from "./views.js";
import { diffTests } from "./diffs.js";

const args = process.argv.slice(2);
const testDataPath = args[3];

export default async function runWorkbenchTests(database) {
await runTests(database, databaseTests);
await runTests(database, branchTests);
Expand All @@ -37,10 +40,7 @@ async function runTests(database, tests) {
values,
// For LOAD DATA
infileStreamFactory: test.file
? () =>
fs.createReadStream(
path.resolve(process.cwd(), "..", test.file)
)
? () => fs.createReadStream(path.resolve(testDataPath, test.file))
: undefined,
})
.then((rows) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ export const tableTests = [
},
},
{
q: `LOAD DATA LOCAL INFILE '../../testdata/update_test_info.csv'
q: `LOAD DATA LOCAL INFILE '../testdata/update_test_info.csv'
INTO TABLE \`test_info\`
FIELDS TERMINATED BY ',' ENCLOSED BY ''
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;`,
file: "testdata/update_test_info.csv",
file: "update_test_info.csv",
res: {
fieldCount: 0,
affectedRows: 3,
Expand Down Expand Up @@ -211,12 +211,12 @@ export const tableTests = [
],
},
{
q: `LOAD DATA LOCAL INFILE '../../testdata/replace_test_info.psv'
q: `LOAD DATA LOCAL INFILE '../testdata/replace_test_info.psv'
REPLACE INTO TABLE \`test_info\`
FIELDS TERMINATED BY '|' ENCLOSED BY ''
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;`,
file: "testdata/replace_test_info.psv",
file: "replace_test_info.psv",
res: {
fieldCount: 0,
affectedRows: 6,
Expand Down

0 comments on commit c747d6c

Please sign in to comment.