Skip to content

Commit

Permalink
[DPE-6347] full replica set tf (#380)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
MiaAltieri and Gu1nness authored Jan 23, 2025
1 parent 3dab8e3 commit 61c401d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
on:
pull_request:
schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
- cron: "53 0 * * *" # Daily at 00:53 UTC
# Triggered on push to branch "main" by .github/workflows/release.yaml
workflow_call:
outputs:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Check libs
uses: canonical/charming-actions/[email protected]
with:
charmcraft-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
charmcraft-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
credentials: ${{ secrets.CHARMHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
use-labels: false
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
terraform fmt
terraform validate
- name: lint test charm module
working-directory: ./terraform/tests
working-directory: ./terraform/modules
run: |
terraform init
terraform fmt
Expand All @@ -102,7 +102,7 @@ jobs:
juju model-defaults logging-config='<root>=INFO; unit=DEBUG'
juju add-model test
- name: Terraform deploy
working-directory: ./terraform/tests/
working-directory: ./terraform/modules
run: |
terraform apply -var "model_name=test" -target null_resource.simple_deployment_juju_wait_deployment -auto-approve
Expand All @@ -116,7 +116,7 @@ jobs:
- tests/integration/ha_tests/application_charm
- tests/integration/relation_tests/application-charm
with:
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
path-to-charm-directory: ${{ matrix.path }}

integration-test:
Expand All @@ -129,8 +129,8 @@ jobs:
with:
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
cloud: microk8s
microk8s-snap-channel: 1.29-strict/stable # renovate: latest microk8s
juju-agent-version: 3.6.1 # renovate: juju-agent-pin-minor
microk8s-snap-channel: 1.29-strict/stable # renovate: latest microk8s
juju-agent-version: 3.6.1 # renovate: juju-agent-pin-minor
_beta_allure_report: true
permissions:
contents: write # Needed for Allure Report beta
Expand Down
9 changes: 9 additions & 0 deletions terraform/tests/preamble.tf → terraform/modules/preamble.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ resource "juju_application" "data-integrator" {
model = var.model_name
depends_on = [null_resource.preamble]
}

resource "juju_application" "s3-integrator" {
charm {
name = "s3-integrator"
channel = "latest/stable"
}
model = var.model_name
depends_on = [null_resource.preamble]
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module "mongodb-k8s" {
channel = "6/edge"
}

resource "juju_integration" "simple_deployment_tls-operator_mongodb-integration" {
resource "juju_integration" "tls-operator_mongodb-integration" {
model = var.model_name

application {
Expand All @@ -22,7 +22,7 @@ resource "juju_integration" "simple_deployment_tls-operator_mongodb-integration"

}

resource "juju_integration" "simple_deployment_data-integrator_mongodb-integration" {
resource "juju_integration" "data-integrator_mongodb-integration" {
model = var.model_name

application {
Expand All @@ -38,12 +38,29 @@ resource "juju_integration" "simple_deployment_data-integrator_mongodb-integrati

}

resource "null_resource" "simple_deployment_juju_wait_deployment" {
resource "juju_integration" "s3-integrator_mongodb-integration" {
model = var.model_name

application {
name = juju_application.s3-integrator.name
}
application {
name = var.app_name
}
depends_on = [
juju_application.s3-integrator,
module.mongodb-k8s
]

}


resource "null_resource" "juju_wait_deployment" {
provisioner "local-exec" {
command = <<-EOT
juju-wait -v --model ${var.model_name}
EOT
}

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

0 comments on commit 61c401d

Please sign in to comment.