Skip to content

Commit

Permalink
Avoid start service on end to end tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-piles committed Sep 19, 2024
1 parent 6437dfe commit 5f7997e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ name: Create and publish Docker image

on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- 'main'

env:
REGISTRY: ghcr.io
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,17 @@ jobs:
- name: Lint with flake8
run: ./run check_format

- name: Start service
run: ./run start:testing -d

- name: Check API ready
uses: emilioschepis/wait-for-endpoint@v1.0.3
with:
url: http://localhost:5050/info
method: GET
expected-status: 200
timeout: 60000
interval: 500

- name: Test with unittest
run: ./run test
5 changes: 0 additions & 5 deletions src/QueueProcessor.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import os
from time import sleep

import redis
from pydantic import ValidationError
from queue_processor.QueueProcessor import QueueProcessor
from rsmq.consumer import RedisSMQConsumer
from rsmq import RedisSMQ
from sentry_sdk.integrations.redis import RedisIntegration
import sentry_sdk

Expand Down
7 changes: 0 additions & 7 deletions src/test_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ def setUp(self):
shutil.rmtree(config.paths["processed_pdfs"], ignore_errors=True)
shutil.rmtree(config.paths["failed_pdfs"], ignore_errors=True)

def setUpClass():
subprocess.run("./run start:testing -d", shell=True)
time.sleep(1)

def tearDownClass():
subprocess.run("./run stop", shell=True)

def test_sync_ocr(self):
ocr_text = self.sync_ocr("sample-english.pdf")
self.assertEqual("Test text OCR", ocr_text)
Expand Down

0 comments on commit 5f7997e

Please sign in to comment.