Skip to content

Commit

Permalink
Remove last remaining legacy fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
juliocc committed Apr 25, 2023
1 parent 89d0749 commit 97e184e
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 269 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
cp default-versions.tf tools/lockfile
sed -i 's/>=\(.*# tftest\)/=\1/g' tools/lockfile/default-versions.tf
cd tools/lockfile
terraform init
terraform init -upgrade=true
- name: Cache Terraform
uses: actions/cache@v3
Expand Down
3 changes: 1 addition & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,5 @@

pytest_plugins = (
'tests.fixtures',
'tests.legacy_fixtures',
'tests.collectors',
)
57 changes: 0 additions & 57 deletions tests/legacy_fixtures.py

This file was deleted.

24 changes: 0 additions & 24 deletions tests/modules/cloud_config_container_coredns/fixture/main.tf

This file was deleted.

19 changes: 0 additions & 19 deletions tests/modules/cloud_config_container_coredns/fixture/outputs.tf

This file was deleted.

50 changes: 0 additions & 50 deletions tests/modules/cloud_config_container_coredns/fixture/variables.tf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,10 +16,10 @@
import yaml


def test_defaults(apply_runner):
"Test defalt configuration."
_, output = apply_runner()
cloud_config = output['cloud_config']
def test_defaults(plan_summary):
"Test default configuration."
summary = plan_summary('modules/cloud-config-container/coredns/')
cloud_config = summary.outputs['cloud_config']['value']
yaml.safe_load(cloud_config)
assert cloud_config.startswith('#cloud-config')
assert re.findall(r'(?m)^\s+\-\s*path:\s*(\S+)', cloud_config) == [
Expand Down
26 changes: 0 additions & 26 deletions tests/modules/cloud_config_container_mysql/fixture/main.tf

This file was deleted.

19 changes: 0 additions & 19 deletions tests/modules/cloud_config_container_mysql/fixture/outputs.tf

This file was deleted.

54 changes: 0 additions & 54 deletions tests/modules/cloud_config_container_mysql/fixture/variables.tf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,34 +16,34 @@
import yaml


def test_defaults(apply_runner):
def test_defaults(plan_summary):
"Test defalt configuration."
_, output = apply_runner(mysql_password='foo')
cloud_config = output['cloud_config']
# _, output = apply_runner(mysql_password='foo')
summary = plan_summary('modules/cloud-config-container/mysql/',
mysql_password='foo')
cloud_config = summary.outputs['cloud_config']['value']
yaml.safe_load(cloud_config)
assert cloud_config.startswith('#cloud-config')
assert re.findall(r'(?m)^\s+\-\s*path:\s*(\S+)', cloud_config) == [
'/var/lib/docker/daemon.json',
'/run/mysql/secrets/mysql-passwd.txt',
'/var/lib/docker/daemon.json', '/run/mysql/secrets/mysql-passwd.txt',
'/etc/systemd/system/mysql.service'
]
assert 'gcloud' not in cloud_config


def test_kms(apply_runner):
def test_kms(plan_summary):
"Test KMS configuration."
kms_config = (
'{project_id="my-project", keyring="my-keyring", location="eu", key="foo"}'
)
_, output = apply_runner(mysql_password='foo',
kms_config=kms_config)
cloud_config = output['cloud_config']
summary = plan_summary('modules/cloud-config-container/mysql/',
mysql_password='foo', kms_config=kms_config)
cloud_config = summary.outputs['cloud_config']['value']
yaml.safe_load(cloud_config)
assert cloud_config.startswith('#cloud-config')
assert re.findall(r'(?m)^\s+\-\s*path:\s*(\S+)', cloud_config) == [
'/var/lib/docker/daemon.json',
'/run/mysql/secrets/mysql-passwd-cipher.txt',
'/run/mysql/passwd.sh',
'/run/mysql/secrets/mysql-passwd-cipher.txt', '/run/mysql/passwd.sh',
'/etc/systemd/system/mysql.service'
]
assert 'gcloud' in cloud_config

0 comments on commit 97e184e

Please sign in to comment.