Skip to content

Commit

Permalink
/{go,integration-tests}: wip, need ci init command to create a commit
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeegoddd committed Oct 22, 2024
1 parent 0068deb commit fed2cb6
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 121 deletions.
6 changes: 4 additions & 2 deletions go/libraries/doltcore/doltdb/system_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ var writeableSystemTables = []string{
ProceduresTableName,
IgnoreTableName,
RebaseTableName,
WorkflowsTableName,
WorkflowEventsTableName,

// todo: for now do not let users write to the tables or alter their schemas
//WorkflowsTableName,
//WorkflowEventsTableName,
}

var persistedSystemTables = []string{
Expand Down
119 changes: 0 additions & 119 deletions integration-tests/bats/ci-config.bats

This file was deleted.

39 changes: 39 additions & 0 deletions integration-tests/bats/ci.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bats
load $BATS_TEST_DIRNAME/helper/common.bash

setup() {
setup_common
}

teardown() {
assert_feature_version
teardown_common
}

@test "ci: init should create dolt ci workflow tables" {
run dolt ci init
[ "$status" -eq 0 ]

run dolt sql -q "select * from dolt_ci_workflows;"
[ "$status" -eq 0 ]
}

@test "ci: dolt_ci_workflows should not allow users to alter the rows or schema of dolt ci workflow tables directly" {
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 fed2cb6

Please sign in to comment.