#!/usr/bin/env bats # # Tests for sql-server running with --remotesapi-port, and specifically the # functionality of the remotesapi under sql-server. load $BATS_TEST_DIRNAME/helper/common.bash srv_pid= srv_two_pid= setup() { skiponwindows "tests are flaky on Windows" setup_common } teardown() { teardown_common if [ -n "$srv_pid" ]; then kill $srv_pid fi if [ -n "$srv_two_pid" ]; then kill $srv_two_pid fi } @test "sql-server-remotesrv: can read from sql-server with --remotesapi-port" { mkdir remote cd remote dolt init dolt sql -q 'create table vals (i int);' dolt sql -q 'insert into vals (i) values (1), (2), (3), (4), (5);' dolt add vals dolt commit -m 'initial vals.' dolt sql-server --remotesapi-port 50051 & srv_pid=$! cd ../ dolt clone http://localhost:50051/remote repo1 cd repo1 run dolt ls [[ "$output" =~ "vals" ]] || false run dolt sql -q 'select count(*) from vals' [[ "$output" =~ "5" ]] || false dolt sql-client -u root <