Skip to content

Commit d0b6ea8

Browse files
committed
Fix ClickHouse integration test to skip when database unavailable
- Add environment variable check for RUN_CLICKHOUSE_INTEGRATION_TEST - Skip integration tests when ClickHouse is not available - This fixes CI test failures when ClickHouse server is not running Signed-off-by: Mehmet TOSUN <[email protected]>
1 parent c23e006 commit d0b6ea8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

state/clickhouse/clickhouse_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ limitations under the License.
1414
package clickhouse
1515

1616
import (
17+
"os"
1718
"testing"
1819

1920
"github.com/stretchr/testify/assert"
@@ -38,6 +39,11 @@ func TestClickHouseIntegration(t *testing.T) {
3839
t.Skip("Skipping integration test")
3940
}
4041

42+
// Check if ClickHouse is available
43+
if os.Getenv("RUN_CLICKHOUSE_INTEGRATION_TEST") == "" {
44+
t.Skip("Skipping ClickHouse integration test. Set RUN_CLICKHOUSE_INTEGRATION_TEST=1 to run")
45+
}
46+
4147
store := NewClickHouseStateStore(logger.NewLogger("test"))
4248
ctx := t.Context()
4349

0 commit comments

Comments
 (0)