From 17806281dcee9aa24c2b6927472ed90c0cbda5b0 Mon Sep 17 00:00:00 2001 From: Kian Parvin Date: Wed, 4 Sep 2024 09:32:05 +0200 Subject: [PATCH] feat: improve test speed - Don't use postgres charms that require storage when running offer tests. --- internal/provider/data_source_offer_test.go | 4 ++-- internal/provider/resource_offer_test.go | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/provider/data_source_offer_test.go b/internal/provider/data_source_offer_test.go index 70e05f98..a4bcb798 100644 --- a/internal/provider/data_source_offer_test.go +++ b/internal/provider/data_source_offer_test.go @@ -73,7 +73,7 @@ resource "juju_application" "this" { name = "this" charm { - name = "postgresql" + name = "juju-qa-dummy-source" %s } } @@ -81,7 +81,7 @@ resource "juju_application" "this" { resource "juju_offer" "this" { model = juju_model.this.name application_name = juju_application.this.name - endpoint = "db" + endpoint = "sink" name = %q } diff --git a/internal/provider/resource_offer_test.go b/internal/provider/resource_offer_test.go index 982acbbd..d38aac68 100644 --- a/internal/provider/resource_offer_test.go +++ b/internal/provider/resource_offer_test.go @@ -37,7 +37,7 @@ func TestAcc_ResourceOffer(t *testing.T) { resource.TestCheckResourceAttr("juju_integration.int", "model", destModelName), resource.TestCheckTypeSetElemNestedAttrs("juju_integration.int", "application.*", - map[string]string{"name": "apptwo", "endpoint": "db", "offer_url": ""}), + map[string]string{"name": "apptwo", "endpoint": "source", "offer_url": ""}), resource.TestCheckTypeSetElemNestedAttrs("juju_integration.int", "application.*", map[string]string{"name": "", "endpoint": "", "offer_url": fmt.Sprintf("%v/%v.%v", "admin", @@ -65,7 +65,7 @@ resource "juju_application" "appone" { name = "appone" charm { - name = "postgresql" + name = "juju-qa-dummy-source" base = "ubuntu@22.04" } } @@ -73,7 +73,7 @@ resource "juju_application" "appone" { resource "juju_offer" "offerone" { model = juju_model.modelone.name application_name = juju_application.appone.name - endpoint = "db" + endpoint = "sink" } resource "juju_model" "modeldest" { @@ -85,8 +85,8 @@ resource "juju_application" "apptwo" { name = "apptwo" charm { - name = "hello-juju" - base = "ubuntu@20.04" + name = "juju-qa-dummy-sink" + base = "ubuntu@22.04" } } @@ -95,6 +95,7 @@ resource "juju_integration" "int" { application { name = juju_application.apptwo.name + endpoint = "source" } application {