Skip to content

Commit 7b0cc5a

Browse files
authored
fix: revert CI changes to avoid bug (#403)
* fix: revert CI changes to avoid bug * fix: terraform relations * fix: terraform fmt
1 parent 5354c94 commit 7b0cc5a

File tree

4 files changed

+48
-112
lines changed

4 files changed

+48
-112
lines changed

terraform/modules/replica_set/simple_deployment.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ resource "juju_integration" "tls-operator_mongodb-integration" {
1010
model = var.model_name
1111

1212
application {
13-
name = juju_application.self-signed-certificates.name
13+
name = juju_application.self-signed-certificates.name
14+
endpoint = "certificates"
1415
}
1516
application {
16-
name = var.app_name
17+
name = var.app_name
18+
endpoint = "certificates"
1719
}
1820
depends_on = [
1921
juju_application.self-signed-certificates,

terraform/modules/sharded_cluster/sharded_deployment.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module "mongodb-k8s" {
2424
units = each.value.units
2525
channel = "6/edge"
2626
config = {
27-
role = each.value.role
27+
role = each.value.role
2828
}
2929
}
3030

@@ -100,11 +100,13 @@ resource "juju_integration" "tls-operator_mongodb-integration" {
100100
model = var.model_name
101101

102102
application {
103-
name = juju_application.self-signed-certificates.name
103+
name = juju_application.self-signed-certificates.name
104+
endpoint = "certificates"
104105
}
105106

106107
application {
107-
name = each.value.app_name
108+
name = each.value.app_name
109+
endpoint = "certificates"
108110
}
109111

110112
depends_on = [

tests/integration/sharding_tests/helpers.py

Lines changed: 38 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -64,105 +64,44 @@ async def deploy_cluster_components(
6464
if channel
6565
else {"mongodb-image": METADATA["resources"]["mongodb-image"]["upstream-source"]}
6666
)
67-
if channel is None:
68-
await ops_test.model.deploy(
69-
my_charm,
70-
resources=resources,
71-
num_units=num_units_cluster_config[CONFIG_SERVER_APP_NAME],
72-
config={"role": "config-server"},
73-
application_name=CONFIG_SERVER_APP_NAME,
74-
channel=channel,
75-
series="jammy",
76-
trust=True,
77-
)
78-
await ops_test.model.deploy(
79-
my_charm,
80-
resources=resources,
81-
num_units=num_units_cluster_config[SHARD_ONE_APP_NAME],
82-
config={"role": "shard"},
83-
application_name=SHARD_ONE_APP_NAME,
84-
channel=channel,
85-
series="jammy",
86-
trust=True,
87-
)
88-
await ops_test.model.deploy(
89-
my_charm,
90-
resources=resources,
91-
num_units=num_units_cluster_config[SHARD_TWO_APP_NAME],
92-
config={"role": "shard"},
93-
application_name=SHARD_TWO_APP_NAME,
94-
channel=channel,
95-
series="jammy",
96-
trust=True,
97-
)
98-
99-
await ops_test.model.wait_for_idle(
100-
apps=CLUSTER_COMPONENTS,
101-
idle_period=20,
102-
timeout=TIMEOUT,
103-
raise_on_blocked=False,
104-
raise_on_error=False,
105-
)
106-
# FIXME: (revert this) Deploy 1 and scale up due to silly bug fixed but unreleased
107-
else:
108-
await ops_test.model.deploy(
109-
my_charm,
110-
resources=resources,
111-
num_units=1,
112-
config={"role": "config-server"},
113-
application_name=CONFIG_SERVER_APP_NAME,
114-
channel=channel,
115-
series="jammy",
116-
trust=True,
117-
)
118-
await ops_test.model.deploy(
119-
my_charm,
120-
resources=resources,
121-
num_units=1,
122-
config={"role": "shard"},
123-
application_name=SHARD_ONE_APP_NAME,
124-
channel=channel,
125-
series="jammy",
126-
trust=True,
127-
)
128-
await ops_test.model.deploy(
129-
my_charm,
130-
resources=resources,
131-
num_units=1,
132-
config={"role": "shard"},
133-
application_name=SHARD_TWO_APP_NAME,
134-
channel=channel,
135-
series="jammy",
136-
trust=True,
137-
)
138-
# Wait a bit before scaling up
139-
await ops_test.model.wait_for_idle(
140-
apps=CLUSTER_COMPONENTS,
141-
idle_period=20,
142-
timeout=TIMEOUT,
143-
raise_on_blocked=False,
144-
raise_on_error=False,
145-
)
146-
if num_units_cluster_config[CONFIG_SERVER_APP_NAME] != 1:
147-
await ops_test.model.applications[CONFIG_SERVER_APP_NAME].scale(
148-
num_units_cluster_config[CONFIG_SERVER_APP_NAME]
149-
)
150-
151-
if num_units_cluster_config[SHARD_ONE_APP_NAME] != 1:
152-
await ops_test.model.applications[SHARD_ONE_APP_NAME].scale(
153-
num_units_cluster_config[SHARD_ONE_APP_NAME]
154-
)
155-
if num_units_cluster_config[SHARD_TWO_APP_NAME] != 1:
156-
await ops_test.model.applications[SHARD_TWO_APP_NAME].scale(
157-
num_units_cluster_config[SHARD_TWO_APP_NAME]
158-
)
159-
await ops_test.model.wait_for_idle(
160-
apps=CLUSTER_COMPONENTS,
161-
idle_period=20,
162-
timeout=TIMEOUT,
163-
raise_on_blocked=False,
164-
raise_on_error=False,
165-
)
67+
await ops_test.model.deploy(
68+
my_charm,
69+
resources=resources,
70+
num_units=num_units_cluster_config[CONFIG_SERVER_APP_NAME],
71+
config={"role": "config-server"},
72+
application_name=CONFIG_SERVER_APP_NAME,
73+
channel=channel,
74+
series="jammy",
75+
trust=True,
76+
)
77+
await ops_test.model.deploy(
78+
my_charm,
79+
resources=resources,
80+
num_units=num_units_cluster_config[SHARD_ONE_APP_NAME],
81+
config={"role": "shard"},
82+
application_name=SHARD_ONE_APP_NAME,
83+
channel=channel,
84+
series="jammy",
85+
trust=True,
86+
)
87+
await ops_test.model.deploy(
88+
my_charm,
89+
resources=resources,
90+
num_units=num_units_cluster_config[SHARD_TWO_APP_NAME],
91+
config={"role": "shard"},
92+
application_name=SHARD_TWO_APP_NAME,
93+
channel=channel,
94+
series="jammy",
95+
trust=True,
96+
)
97+
98+
await ops_test.model.wait_for_idle(
99+
apps=CLUSTER_COMPONENTS,
100+
idle_period=20,
101+
timeout=TIMEOUT,
102+
raise_on_blocked=False,
103+
raise_on_error=False,
104+
)
166105

167106

168107
async def integrate_cluster(ops_test: OpsTest) -> None:

tests/integration/upgrades/test_upgrades.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,7 @@ async def test_build_and_deploy(ops_test: OpsTest):
4848
await check_or_scale_app(ops_test, db_app_name, required_units=3)
4949
return
5050
else:
51-
# FIXME: (revert this) Deploy 1 and scale up due to silly bug fixed but unreleased.
52-
await ops_test.model.deploy(MONGODB_CHARM_NAME, channel="6/edge", num_units=1, trust=True)
53-
54-
await ops_test.model.wait_for_idle(
55-
apps=[MONGODB_CHARM_NAME], status="active", timeout=DEPLOYMENT_TIMEOUT
56-
)
57-
58-
await ops_test.model.applications[MONGODB_CHARM_NAME].scale(3)
51+
await ops_test.model.deploy(MONGODB_CHARM_NAME, channel="6/edge", num_units=3, trust=True)
5952

6053
db_app_name = await get_app_name(ops_test)
6154
await ops_test.model.wait_for_idle(

0 commit comments

Comments
 (0)