diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68298e2..e9c507d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,46 +1,43 @@ -name: Continuous Integration - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - build: - name: Build Docker image and run end-to-end tests - runs-on: ubuntu-latest - steps: - - name: Checkout code from GitHub - uses: actions/checkout@v5 - - - name: Run end-to-end tests - run: > - docker compose --profile testing up - --build --exit-code-from test-service - - # временно отключено - #- name: Login to Docker Hub - # uses: docker/login-action@v3 - # if: ${{ github.event_name == 'push' }} - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - - # временно отключено - #- name: Push image to Docker Hub - # uses: docker/build-push-action@v6 - # if: ${{ github.event_name == 'push' }} - # with: - # context: ./web - # push: true - # tags: | - # ${{ secrets.DOCKERHUB_USERNAME }}/page-tracker:${{ github.sha }} - # ${{ secrets.DOCKERHUB_USERNAME }}/page-tracker:latest - - - - - +name: Continuous Integration + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build: + name: Build Docker image and run end-to-end tests + runs-on: ubuntu-latest + steps: + - name: Checkout code from GitHub + uses: actions/checkout@v5 + + - name: Run end-to-end tests + run: > + docker compose --profile testing up + --build --exit-code-from test-service + + # временно отключено + #- name: Login to Docker Hub + # uses: docker/login-action@v3 + # if: ${{ github.event_name == 'push' }} + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + + # временно отключено + #- name: Push image to Docker Hub + # uses: docker/build-push-action@v6 + # if: ${{ github.event_name == 'push' }} + # with: + # context: ./web + # push: true + # tags: | + # ${{ secrets.DOCKERHUB_USERNAME }}/page-tracker:${{ github.sha }} + # ${{ secrets.DOCKERHUB_USERNAME }}/page-tracker:latest + + \ No newline at end of file diff --git a/web/src/page_tracker/app.py b/web/src/page_tracker/app.py index c854969..0c14c9d 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 seen {page_views} times." diff --git a/web/tests/unit/test_app.py b/web/tests/unit/test_app.py index f6c3c9c..ab40448 100644 --- a/web/tests/unit/test_app.py +++ b/web/tests/unit/test_app.py @@ -11,7 +11,7 @@ def test_should_handle_redis_connection_error(mock_redis, http_client): #Then 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}" @unittest.mock.patch("src.page_tracker.app.redis") def test_should_call_redis_incr(mock_redis, http_client):