diff --git a/integration-tests/mysql-client-tests/node/helpers.js b/integration-tests/mysql-client-tests/node/helpers.js index ac622f7cee..3935ee571d 100644 --- a/integration-tests/mysql-client-tests/node/helpers.js +++ b/integration-tests/mysql-client-tests/node/helpers.js @@ -26,10 +26,6 @@ export function assertQueryResult(q, resultStr, expected, rows, matcher) { if (q.toLowerCase().includes("dolt_commit")) { return rows.length === 1 && rows[0].hash.length === 32; } - if (q.toLowerCase().includes("dolt_merge")) { - const result = JSON.parse(resultStr); - return expected.fast_forward === result.fast_forward && expected.conflicts === result.conflicts; - } return resultStr === JSON.stringify(expected); } diff --git a/integration-tests/mysql-client-tests/node/index.js b/integration-tests/mysql-client-tests/node/index.js index 1a8675f9c9..bfeaf949f8 100644 --- a/integration-tests/mysql-client-tests/node/index.js +++ b/integration-tests/mysql-client-tests/node/index.js @@ -50,7 +50,10 @@ const tests = [ { q: "call dolt_add('-A');", res: [{ status: 0 }] }, { q: "call dolt_commit('-m', 'my commit')", res: [] }, { q: "select COUNT(*) FROM dolt_log", res: [{ "COUNT(*)": 2 }] }, - { q: "call dolt_checkout('-b', 'mybranch')", res: [{ status: 0, message: "Switched to branch 'mybranch'" }] }, + { + q: "call dolt_checkout('-b', 'mybranch')", + res: [{ status: 0, message: "Switched to branch 'mybranch'" }], + }, { q: "insert into test (pk, `value`) values (1,1)", res: { @@ -63,7 +66,10 @@ const tests = [ }, }, { q: "call dolt_commit('-a', '-m', 'my commit2')", res: [] }, - { q: "call dolt_checkout('main')", res: [{ status: 0, message: "Switched to branch 'main'" }] }, + { + q: "call dolt_checkout('main')", + res: [{ status: 0, message: "Switched to branch 'main'" }], + }, { q: "call dolt_merge('mybranch')", res: [{ fast_forward: 1, conflicts: 0 }], diff --git a/integration-tests/mysql-client-tests/node/workbenchTests/matchers.js b/integration-tests/mysql-client-tests/node/workbenchTests/matchers.js index 3f642eba65..132eed2165 100644 --- a/integration-tests/mysql-client-tests/node/workbenchTests/matchers.js +++ b/integration-tests/mysql-client-tests/node/workbenchTests/matchers.js @@ -95,6 +95,22 @@ export function mergeBaseMatcher(rows, exp) { return true; } +export function mergeMatcher(rows, exp) { + const exceptionKeys = ["hash"]; + + function getExceptionIsValid(row, key) { + const val = row[key]; + switch (key) { + case "hash": + return commitHashIsValid(val); + default: + return false; + } + } + + return matcher(rows, exp, exceptionKeys, getExceptionIsValid); +} + export function tagsMatcher(rows, exp) { const exceptionKeys = ["tag_hash", "date"]; diff --git a/integration-tests/mysql-client-tests/node/workbenchTests/merge.js b/integration-tests/mysql-client-tests/node/workbenchTests/merge.js index de634e58dc..940408fff2 100644 --- a/integration-tests/mysql-client-tests/node/workbenchTests/merge.js +++ b/integration-tests/mysql-client-tests/node/workbenchTests/merge.js @@ -1,4 +1,4 @@ -import { logsMatcher, mergeBaseMatcher } from "./matchers.js"; +import { logsMatcher, mergeBaseMatcher, mergeMatcher } from "./matchers.js"; export const mergeTests = [ { @@ -14,7 +14,8 @@ export const mergeTests = [ { q: `CALL DOLT_MERGE(:branchName, "--no-ff", "-m", :commitMsg)`, p: { branchName: "mybranch", commitMsg: "Merge mybranch into main" }, - res: [{ fast_forward: 0, conflicts: 0 }], + res: [{ hash: "", fast_forward: 0, conflicts: 0 }], + matcher: mergeMatcher, }, { q: `SELECT * FROM DOLT_LOG(:refName, '--parents') LIMIT :limit OFFSET :offset`, diff --git a/integration-tests/mysql-client-tests/node/workbenchTests/table.js b/integration-tests/mysql-client-tests/node/workbenchTests/table.js index e401892f36..1f67326739 100644 --- a/integration-tests/mysql-client-tests/node/workbenchTests/table.js +++ b/integration-tests/mysql-client-tests/node/workbenchTests/table.js @@ -74,7 +74,7 @@ export const tableTests = [ FROM information_schema.statistics WHERE table_schema=:tableSchema AND table_name=:tableName AND index_name!="PRIMARY" GROUP BY index_name;`, - p: { tableSchema: `${dbName}`, tableName: "test" }, + p: { tableSchema: `${dbName}/main`, tableName: "test" }, res: [ { TABLE_NAME: "test", @@ -122,19 +122,19 @@ export const tableTests = [ }, { q: `SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE table_name=:tableName AND table_schema=:tableSchema AND referenced_table_schema IS NOT NULL`, - p: { tableName: "test_info", tableSchema: `${dbName}` }, + p: { tableName: "test_info", tableSchema: `${dbName}/main` }, res: [ { CONSTRAINT_CATALOG: "def", - CONSTRAINT_SCHEMA: `${dbName}`, + CONSTRAINT_SCHEMA: `${dbName}/main`, CONSTRAINT_NAME: "s7utamh8", TABLE_CATALOG: "def", - TABLE_SCHEMA: `${dbName}`, + TABLE_SCHEMA: `${dbName}/main`, TABLE_NAME: "test_info", COLUMN_NAME: "test_pk", ORDINAL_POSITION: 1, POSITION_IN_UNIQUE_CONSTRAINT: 1, - REFERENCED_TABLE_SCHEMA: `${dbName}`, + REFERENCED_TABLE_SCHEMA: dbName, REFERENCED_TABLE_NAME: "test", REFERENCED_COLUMN_NAME: "pk", }, @@ -270,7 +270,7 @@ export const tableTests = [ }, { q: "CALL DOLT_CHECKOUT('test_info')", - res: [{ status: 0 }], + res: [{ status: 0, message: "" }], }, { q: `SELECT * FROM dolt_status`,