diff --git a/integration-tests/bats/ci.bats b/integration-tests/bats/ci.bats index c152bd3872..25becae167 100644 --- a/integration-tests/bats/ci.bats +++ b/integration-tests/bats/ci.bats @@ -10,8 +10,15 @@ teardown() { teardown_common } +skip_remote_engine() { + if [ "$SQL_ENGINE" = "remote-engine" ]; then + skip "session ctx in shell is not the same as session in server" + fi +} + @test "ci: init should create dolt ci workflow tables" { - dolt ci init + skip_remote_engine + run dolt ci init [ "$status" -eq 0 ] @@ -29,3 +36,24 @@ teardown() { [ "$status" -eq 0 ] } +@test "ci: should not allow users to alter the rows or schema of dolt ci workflow tables directly" { + skip_remote_engine + + run dolt ci init + [ "$status" -eq 0 ] + + run dolt sql -q "show create table dolt_ci_workflows;" + [ "$status" -eq 0 ] + [[ "$output" =~ "name" ]] || false + + run dolt sql -q "insert into dolt_ci_workflows (name, created_at, updated_at) values ('workflow_1', current_timestamp, current_timestamp);" + [ "$status" -eq 1 ] + + run dolt sql -q "alter table dolt_ci_workflows add column test_col int;" + [ "$status" -eq 1 ] + [[ "$output" =~ "table dolt_ci_workflows cannot be altered" ]] || false + + run dolt sql -q "alter table dolt_ci_workflows drop column name;" + [ "$status" -eq 1 ] + [[ "$output" =~ "table dolt_ci_workflows cannot be altered" ]] || false +}