From ec097720fab0c9e529d99a72c6a6fdad9f2e1fe6 Mon Sep 17 00:00:00 2001 From: Jiakai Li Date: Tue, 10 Sep 2024 10:06:44 +1200 Subject: [PATCH 1/2] Replace the emoji in an error message --- .github/workflows/ci.yml | 2 +- web/src/page_tracker/app.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b16b580..a23dd03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v3 - name: Run end-to-end tests run: > - docker-compose --profile testing up + docker compose --profile testing up --build --exit-code-from test - name: Login to Docker Hub diff --git a/web/src/page_tracker/app.py b/web/src/page_tracker/app.py index 62b9ae3..a705134 100644 --- a/web/src/page_tracker/app.py +++ b/web/src/page_tracker/app.py @@ -13,7 +13,7 @@ def index(): page_views = redis().incr("page_views") except RedisError: app.logger.exception("Redis error") - return "Sorry, something went wrong \N{pensive face}", 500 + return "Sorry, something went wrong \N{thinking face}", 500 else: return f"This page has been viewed {page_views} times" From 9d2833bff386a1d944969329e46202abfff8d687 Mon Sep 17 00:00:00 2001 From: Jiakai Li Date: Tue, 10 Sep 2024 10:11:35 +1200 Subject: [PATCH 2/2] fix the failing unit test --- web/test/unit/test_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/test/unit/test_app.py b/web/test/unit/test_app.py index b6b020a..aeda254 100644 --- a/web/test/unit/test_app.py +++ b/web/test/unit/test_app.py @@ -18,4 +18,4 @@ def test_should_handle_redis_connection_error(mock_redis, http_client): mock_redis.return_value.incr.side_effect = ConnectionError response = http_client.get("/") assert response.status_code == 500 - assert response.text == "Sorry, something went wrong \N{pensive face}" + assert response.text == "Sorry, something went wrong \N{thinking face}"