Skip to content

tests/integration: Fix paths to compose.yaml files for testing override and reset tags #1203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/integration/merge/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@


def compose_yaml_path():
return os.path.join(os.path.join(test_path(), "override_tag_attribute"), "docker-compose.yaml")
return os.path.join(
test_path(),
"merge/reset_and_override_tags/override_tag_attribute/docker-compose.yaml",
)


class TestComposeOverrideTagAttribute(unittest.TestCase, RunSubprocessMixin):
# test if a service attribute from docker-compose.yaml file is overridden
def test_override_tag_attribute(self):
override_file = os.path.join(
os.path.join(test_path(), "override_tag_attribute"),
"docker-compose.override_attribute.yaml",
test_path(),
"merge/reset_and_override_tags/override_tag_attribute/docker-compose.override_attribute.yaml",
)
try:
self.run_subprocess_assert_returncode([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@


def compose_yaml_path():
return os.path.join(os.path.join(test_path(), "override_tag_service"), "docker-compose.yaml")
return os.path.join(
test_path(),
"merge/reset_and_override_tags/override_tag_service/docker-compose.yaml",
)


class TestComposeOverrideTagService(unittest.TestCase, RunSubprocessMixin):
# test if whole service from docker-compose.yaml file is overridden in another file
def test_override_tag_service(self):
override_file = os.path.join(
os.path.join(test_path(), "override_tag_service"),
"docker-compose.override_service.yaml",
test_path(),
"merge/reset_and_override_tags/override_tag_service/docker-compose.override_service.yaml",
)
try:
self.run_subprocess_assert_returncode([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@


def compose_yaml_path():
return os.path.join(os.path.join(test_path(), "reset_tag_attribute"), "docker-compose.yaml")
return os.path.join(
test_path(),
"merge/reset_and_override_tags/reset_tag_attribute/docker-compose.yaml",
)


class TestComposeResetTagAttribute(unittest.TestCase, RunSubprocessMixin):
# test if the attribute of the service is correctly reset
def test_reset_tag_attribute(self):
reset_file = os.path.join(
os.path.join(test_path(), "reset_tag_attribute"), "docker-compose.reset_attribute.yaml"
test_path(),
"merge/reset_and_override_tags/reset_tag_attribute/docker-compose.reset_attribute.yaml",
)
try:
self.run_subprocess_assert_returncode([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@


def compose_yaml_path():
return os.path.join(os.path.join(test_path(), "reset_tag_service"), "docker-compose.yaml")
return os.path.join(
test_path(), "merge/reset_and_override_tags/reset_tag_service/docker-compose.yaml"
)


class TestComposeResetTagService(unittest.TestCase, RunSubprocessMixin):
# test if whole service from docker-compose.yaml file is reset
def test_reset_tag_service(self):
reset_file = os.path.join(
os.path.join(test_path(), "reset_tag_service"), "docker-compose.reset_service.yaml"
test_path(),
"merge/reset_and_override_tags/reset_tag_service/docker-compose.reset_service.yaml",
)
try:
self.run_subprocess_assert_returncode([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

def compose_yaml_path(compose_name):
""" "Returns the path to the compose file used for this test module"""
base_path = os.path.join(test_path(), "volumes_merge/")
base_path = os.path.join(test_path(), "merge/volumes_merge/")
return os.path.join(base_path, compose_name)


Expand Down Expand Up @@ -55,7 +55,7 @@ def test_volumes_merge(self):
binds_info = volumes_info["HostConfig"]["Binds"]
binds_info.sort()

file_path = os.path.join(test_path(), "volumes_merge/override.txt")
file_path = os.path.join(test_path(), "merge/volumes_merge/override.txt")
expected = [
f'{file_path}:/var/www/html/index.html:ro,rprivate,rbind',
f'{file_path}:/var/www/html/index2.html:rw,rprivate,rbind',
Expand Down