Skip to content

Commit

Permalink
/integration-tests/bats/ci.bats: skip dolt ci commands with remote-en…
Browse files Browse the repository at this point in the history
…gine
  • Loading branch information
coffeegoddd committed Oct 24, 2024
1 parent d2d6213 commit 9d0cdef
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion integration-tests/bats/ci.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]

Expand All @@ -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
}

0 comments on commit 9d0cdef

Please sign in to comment.