Skip to content

Commit 3845da9

Browse files
authored
[DPE-6112] Dual branch config and test tweaks (#894)
* Dual branch config and test tweaks * Missed tests * Try test differences from 16
1 parent e70779b commit 3845da9

File tree

13 files changed

+22
-60
lines changed

13 files changed

+22
-60
lines changed

.github/renovate.json5

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,15 @@
66
reviewers: [
77
'team:data-platform-postgresql',
88
],
9+
"baseBranches": ["main", "/^*\\/edge$/"],
910
packageRules: [
1011
{
1112
matchPackageNames: [
1213
'pydantic',
1314
],
1415
allowedVersions: '<2.0.0',
1516
},
16-
{
17-
matchManagers: [
18-
'custom.regex',
19-
],
20-
matchDepNames: [
21-
'juju',
22-
],
23-
matchDatasources: [
24-
'pypi',
25-
],
26-
allowedVersions: '<3',
27-
groupName: 'Juju agents',
28-
},
2917
],
3018
customManagers: [
31-
{
32-
customType: 'regex',
33-
fileMatch: [
34-
'^\\.github/workflows/[^/]+\\.ya?ml$',
35-
],
36-
matchStrings: [
37-
'(libjuju: )==(?<currentValue>.*?) +# renovate: latest libjuju 2',
38-
],
39-
depNameTemplate: 'juju',
40-
datasourceTemplate: 'pypi',
41-
versioningTemplate: 'loose',
42-
},
4319
],
4420
}

.github/workflows/check_pr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- edited
1212
branches:
1313
- main
14+
- '*/edge'
1415

1516
jobs:
1617
check-pr:

tests/integration/ha_tests/test_smoke.py

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
from pytest_operator.plugin import OpsTest
1111
from tenacity import Retrying, stop_after_delay, wait_fixed
1212

13-
from .. import markers
1413
from ..helpers import (
1514
CHARM_BASE,
1615
DATABASE_APP_NAME,
16+
METADATA,
17+
build_and_deploy,
1718
scale_application,
1819
)
1920
from .helpers import (
@@ -43,24 +44,13 @@
4344
env["KUBECONFIG"] = os.path.expanduser("~/.kube/config")
4445

4546

46-
@markers.amd64_only # TODO: remove after arm64 stable release
4747
@pytest.mark.abort_on_fail
48-
async def test_app_force_removal(ops_test: OpsTest):
48+
async def test_app_force_removal(ops_test: OpsTest, charm):
4949
"""Remove unit with force while storage is alive."""
5050
global primary_pv, primary_pvc
5151
# Deploy the charm.
5252
async with ops_test.fast_forward():
53-
await ops_test.model.deploy(
54-
DATABASE_APP_NAME,
55-
application_name=DATABASE_APP_NAME,
56-
num_units=1,
57-
channel="14/stable",
58-
base=CHARM_BASE,
59-
trust=True,
60-
config={"profile": "testing"},
61-
)
62-
63-
await ops_test.model.wait_for_idle(status="active", timeout=1000)
53+
await build_and_deploy(ops_test, charm, 1)
6454

6555
assert ops_test.model.applications[DATABASE_APP_NAME].units[0].workload_status == "active"
6656

@@ -103,7 +93,6 @@ async def test_app_force_removal(ops_test: OpsTest):
10393
assert await is_storage_exists(ops_test, storage_id)
10494

10595

106-
@markers.amd64_only # TODO: remove after arm64 stable release
10796
@pytest.mark.abort_on_fail
10897
async def test_app_garbage_ignorance(ops_test: OpsTest):
10998
"""Test charm deploy in dirty environment with garbage storage."""
@@ -155,17 +144,19 @@ async def test_app_garbage_ignorance(ops_test: OpsTest):
155144
delete_pvc(ops_test, primary_pvc)
156145

157146

158-
@markers.amd64_only # TODO: remove after arm64 stable release
159147
@pytest.mark.abort_on_fail
160-
async def test_app_resources_conflicts(ops_test: OpsTest):
148+
async def test_app_resources_conflicts(ops_test: OpsTest, charm):
161149
"""Test application deploy in dirty environment with garbage storage from another application."""
162150
global primary_pv, primary_pvc
163151
async with ops_test.fast_forward():
152+
resources = {
153+
"postgresql-image": METADATA["resources"]["postgresql-image"]["upstream-source"],
154+
}
164155
await ops_test.model.deploy(
165-
DATABASE_APP_NAME,
156+
charm,
157+
resources=resources,
166158
application_name=DUP_DATABASE_APP_NAME,
167159
num_units=1,
168-
channel="14/stable",
169160
base=CHARM_BASE,
170161
trust=True,
171162
config={"profile": "testing"},

tests/integration/ha_tests/test_upgrade_from_stable.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from pytest_operator.plugin import OpsTest
1111
from tenacity import Retrying, stop_after_attempt, wait_fixed
1212

13-
from .. import markers
1413
from ..helpers import (
1514
APPLICATION_NAME,
1615
CHARM_BASE,
@@ -32,7 +31,6 @@
3231
TIMEOUT = 10 * 60
3332

3433

35-
@markers.amd64_only # TODO: remove after arm64 stable release
3634
@pytest.mark.abort_on_fail
3735
async def test_deploy_stable(ops_test: OpsTest) -> None:
3836
"""Simple test to ensure that the PostgreSQL and application charms get deployed."""
@@ -59,7 +57,6 @@ async def test_deploy_stable(ops_test: OpsTest) -> None:
5957
assert len(ops_test.model.applications[DATABASE_APP_NAME].units) == 3
6058

6159

62-
@markers.amd64_only # TODO: remove after arm64 stable release
6360
@pytest.mark.abort_on_fail
6461
async def test_pre_upgrade_check(ops_test: OpsTest) -> None:
6562
"""Test that the pre-upgrade-check action runs successfully."""
@@ -91,7 +88,6 @@ async def test_pre_upgrade_check(ops_test: OpsTest) -> None:
9188
assert stateful_set.spec.updateStrategy.rollingUpdate.partition == 2, "Partition not set to 2"
9289

9390

94-
@markers.amd64_only # TODO: remove after arm64 stable release
9591
@pytest.mark.abort_on_fail
9692
async def test_upgrade_from_stable(ops_test: OpsTest, charm, continuous_writes):
9793
"""Test updating from stable channel."""

tests/integration/new_relations/test_new_relations_1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ async def test_admin_role(ops_test: OpsTest):
482482
f"test_{''.join(secrets.choice(string.ascii_lowercase) for _ in range(10))}"
483483
)
484484
should_fail = database == DATABASE_DEFAULT_NAME
485-
cursor.execute(f"CREATE TABLE {random_name}(data TEXT);")
485+
cursor.execute(f"CREATE SCHEMA test; CREATE TABLE test.{random_name}(data TEXT);")
486486
if should_fail:
487487
assert False, (
488488
f"failed to run a statement in the following database: {database}"

tests/integration/test_backups_aws.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
tls_config = {"generate-self-signed-certificates": "true", "ca-common-name": "Test CA"}
3434
else:
3535
tls_certificates_app_name = "self-signed-certificates"
36-
tls_channel = "latest/edge" if architecture.architecture == "arm64" else "latest/stable"
36+
tls_channel = "latest/stable"
3737
tls_config = {"ca-common-name": "Test CA"}
3838

3939
logger = logging.getLogger(__name__)

tests/integration/test_backups_gcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
tls_config = {"generate-self-signed-certificates": "true", "ca-common-name": "Test CA"}
3737
else:
3838
tls_certificates_app_name = "self-signed-certificates"
39-
tls_channel = "latest/edge" if architecture.architecture == "arm64" else "latest/stable"
39+
tls_channel = "latest/stable"
4040
tls_config = {"ca-common-name": "Test CA"}
4141

4242
logger = logging.getLogger(__name__)

tests/integration/test_backups_pitr_aws.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
tls_config = {"generate-self-signed-certificates": "true", "ca-common-name": "Test CA"}
2929
else:
3030
tls_certificates_app_name = "self-signed-certificates"
31-
tls_channel = "latest/edge" if architecture.architecture == "arm64" else "latest/stable"
31+
tls_channel = "latest/stable"
3232
tls_config = {"ca-common-name": "Test CA"}
3333

3434
logger = logging.getLogger(__name__)

tests/integration/test_backups_pitr_gcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
tls_config = {"generate-self-signed-certificates": "true", "ca-common-name": "Test CA"}
2929
else:
3030
tls_certificates_app_name = "self-signed-certificates"
31-
tls_channel = "latest/edge" if architecture.architecture == "arm64" else "latest/stable"
31+
tls_channel = "latest/stable"
3232
tls_config = {"ca-common-name": "Test CA"}
3333

3434
logger = logging.getLogger(__name__)

tests/integration/test_plugins.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@
6262
HYPOPG_EXTENSION_STATEMENT = "CREATE TABLE hypopg_test (id integer, val text); SELECT hypopg_create_index('CREATE INDEX ON hypopg_test (id)');"
6363
IP4R_EXTENSION_STATEMENT = "CREATE TABLE ip4r_test (ip ip4);"
6464
JSONB_PLPERL_EXTENSION_STATEMENT = "CREATE OR REPLACE FUNCTION jsonb_plperl_test(val jsonb) RETURNS jsonb TRANSFORM FOR TYPE jsonb LANGUAGE plperl as $$ return $_[0]; $$;"
65-
ORAFCE_EXTENSION_STATEMENT = "SELECT add_months(date '2005-05-31',1);"
66-
PG_SIMILARITY_EXTENSION_STATEMENT = "SHOW pg_similarity.levenshtein_threshold;"
65+
ORAFCE_EXTENSION_STATEMENT = "SELECT oracle.add_months(date '2005-05-31',1);"
66+
PG_SIMILARITY_EXTENSION_STATEMENT = (
67+
"SET pg_similarity.levenshtein_threshold = 0.7; SELECT 'aaa', 'aab', lev('aaa','aab');"
68+
)
6769
PLPERL_EXTENSION_STATEMENT = "CREATE OR REPLACE FUNCTION plperl_test(name text) RETURNS text AS $$ return $_SHARED{$_[0]}; $$ LANGUAGE plperl;"
6870
PREFIX_EXTENSION_STATEMENT = "SELECT '123'::prefix_range @> '123456';"
6971
RDKIT_EXTENSION_STATEMENT = "SELECT is_valid_smiles('CCC');"

0 commit comments

Comments
 (0)