-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced integration tests for health and ping endpoints. - **Chores** - Updated CI/CD pipeline with a new executor for improved Docker caching and integration testing. - Modified GitHub release creation steps for enhanced automation. - **Refactor** - Updated Dockerfile for optimized application startup. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
7 changed files
with
384 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
|
||
import pytest | ||
import requests | ||
from testcontainers.compose import DockerCompose | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def compose(): | ||
print("Starting compose") | ||
compose = DockerCompose( | ||
context=os.getcwd(), | ||
compose_file_name="docker-compose.yml", | ||
build=True, | ||
wait=True, | ||
) | ||
compose.start() | ||
yield compose | ||
compose.stop() | ||
|
||
|
||
def test_health(compose: DockerCompose): | ||
host = compose.get_service_host("app") | ||
port = compose.get_service_port("app", 80) | ||
assert "Application startup complete." in compose.get_logs("app")[0] | ||
response = requests.get(f"http://{host}:{port}/health") | ||
assert response.status_code == 200 | ||
assert response.text == "UP" | ||
|
||
|
||
def test_ping(compose: DockerCompose): | ||
host = compose.get_service_host("app") | ||
port = compose.get_service_port("app", 80) | ||
response = requests.get(f"http://{host}:{port}/ping") | ||
assert response.status_code == 200 | ||
assert response.text == "PONG" |