From dde293fc3d10470bbe65b5ef4f58a5c2cd2d851e Mon Sep 17 00:00:00 2001 From: Val Date: Wed, 24 Jun 2020 16:37:29 +0300 Subject: [PATCH] check schema after alters in test --- .../test_replicated_database/test.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/integration/test_replicated_database/test.py b/tests/integration/test_replicated_database/test.py index 0b7f8aadec2..346114cb8c4 100644 --- a/tests/integration/test_replicated_database/test.py +++ b/tests/integration/test_replicated_database/test.py @@ -46,6 +46,28 @@ def test_simple_alter_table(started_cluster): main_node.query("ALTER TABLE testdb.alter_test ADD COLUMN AddedNested2 Nested(A UInt32, B UInt64) AFTER AddedNested1;") time.sleep(DURATION_SECONDS) + + schema = main_node.query("show create table testdb.alter_test") + fields = [ + "`CounterID`", + "`StartDate`", + "`UserID`", + "`VisitID`", + "`NestedColumn.A`", + "`NestedColumn.S`", + "`ToDrop`", + "`Added0`", + "`Added1`", + "`Added2`", + "`AddedNested1.A`", + "`AddedNested1.B`", + "`AddedNested1.C`", + "`AddedNested2.A`", + "`AddedNested2.B`"] + + for field in fields: + assert field in schema + assert main_node.query("desc table testdb.alter_test") == dummy_node.query("desc table testdb.alter_test") def test_create_replica_after_delay(started_cluster):