Skip to content

Commit 61c401d

Browse files
MiaAltieriGu1nness
andauthored
[DPE-6347] full replica set tf (#380)
* fix install timeout * update poetry + workflows * remove fields related to packages * fix linting issues * duplicate requirements in separate parts * migrate to use charm_version file per Carls suggestion * give workflow in tox access to poetry export * update charm version to pep format * PR feedback * remove build wrapper * add simple replica set terraform * add latest changes for ci fixes with terraform * remove dir * remove lock * add missing integrations * move tests to modules * pr feedback * Update .github/workflows/ci.yaml Co-authored-by: Neha Oudin <[email protected]> --------- Co-authored-by: Neha Oudin <[email protected]>
1 parent 3dab8e3 commit 61c401d

File tree

5 files changed

+37
-11
lines changed

5 files changed

+37
-11
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ concurrency:
99
on:
1010
pull_request:
1111
schedule:
12-
- cron: '53 0 * * *' # Daily at 00:53 UTC
12+
- cron: "53 0 * * *" # Daily at 00:53 UTC
1313
# Triggered on push to branch "main" by .github/workflows/release.yaml
1414
workflow_call:
1515
outputs:
@@ -37,7 +37,7 @@ jobs:
3737
- name: Check libs
3838
uses: canonical/charming-actions/[email protected]
3939
with:
40-
charmcraft-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
40+
charmcraft-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
4141
credentials: ${{ secrets.CHARMHUB_TOKEN }}
4242
github-token: ${{ secrets.GITHUB_TOKEN }}
4343
use-labels: false
@@ -76,7 +76,7 @@ jobs:
7676
terraform fmt
7777
terraform validate
7878
- name: lint test charm module
79-
working-directory: ./terraform/tests
79+
working-directory: ./terraform/modules
8080
run: |
8181
terraform init
8282
terraform fmt
@@ -102,7 +102,7 @@ jobs:
102102
juju model-defaults logging-config='<root>=INFO; unit=DEBUG'
103103
juju add-model test
104104
- name: Terraform deploy
105-
working-directory: ./terraform/tests/
105+
working-directory: ./terraform/modules
106106
run: |
107107
terraform apply -var "model_name=test" -target null_resource.simple_deployment_juju_wait_deployment -auto-approve
108108
@@ -116,7 +116,7 @@ jobs:
116116
- tests/integration/ha_tests/application_charm
117117
- tests/integration/relation_tests/application-charm
118118
with:
119-
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
119+
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
120120
path-to-charm-directory: ${{ matrix.path }}
121121

122122
integration-test:
@@ -129,8 +129,8 @@ jobs:
129129
with:
130130
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
131131
cloud: microk8s
132-
microk8s-snap-channel: 1.29-strict/stable # renovate: latest microk8s
133-
juju-agent-version: 3.6.1 # renovate: juju-agent-pin-minor
132+
microk8s-snap-channel: 1.29-strict/stable # renovate: latest microk8s
133+
juju-agent-version: 3.6.1 # renovate: juju-agent-pin-minor
134134
_beta_allure_report: true
135135
permissions:
136136
contents: write # Needed for Allure Report beta

terraform/tests/preamble.tf renamed to terraform/modules/preamble.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ resource "juju_application" "data-integrator" {
2323
model = var.model_name
2424
depends_on = [null_resource.preamble]
2525
}
26+
27+
resource "juju_application" "s3-integrator" {
28+
charm {
29+
name = "s3-integrator"
30+
channel = "latest/stable"
31+
}
32+
model = var.model_name
33+
depends_on = [null_resource.preamble]
34+
}
File renamed without changes.

terraform/tests/simple_deployment.tf renamed to terraform/modules/simple_deployment.tf

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module "mongodb-k8s" {
66
channel = "6/edge"
77
}
88

9-
resource "juju_integration" "simple_deployment_tls-operator_mongodb-integration" {
9+
resource "juju_integration" "tls-operator_mongodb-integration" {
1010
model = var.model_name
1111

1212
application {
@@ -22,7 +22,7 @@ resource "juju_integration" "simple_deployment_tls-operator_mongodb-integration"
2222

2323
}
2424

25-
resource "juju_integration" "simple_deployment_data-integrator_mongodb-integration" {
25+
resource "juju_integration" "data-integrator_mongodb-integration" {
2626
model = var.model_name
2727

2828
application {
@@ -38,12 +38,29 @@ resource "juju_integration" "simple_deployment_data-integrator_mongodb-integrati
3838

3939
}
4040

41-
resource "null_resource" "simple_deployment_juju_wait_deployment" {
41+
resource "juju_integration" "s3-integrator_mongodb-integration" {
42+
model = var.model_name
43+
44+
application {
45+
name = juju_application.s3-integrator.name
46+
}
47+
application {
48+
name = var.app_name
49+
}
50+
depends_on = [
51+
juju_application.s3-integrator,
52+
module.mongodb-k8s
53+
]
54+
55+
}
56+
57+
58+
resource "null_resource" "juju_wait_deployment" {
4259
provisioner "local-exec" {
4360
command = <<-EOT
4461
juju-wait -v --model ${var.model_name}
4562
EOT
4663
}
4764

48-
depends_on = [juju_integration.simple_deployment_tls-operator_mongodb-integration]
65+
depends_on = [juju_integration.tls-operator_mongodb-integration]
4966
}
File renamed without changes.

0 commit comments

Comments
 (0)