Skip to content

Commit

Permalink
Merge pull request #2 from robertbetts/develop
Browse files Browse the repository at this point in the history
Develop actions setup
  • Loading branch information
robertbetts authored Sep 4, 2023
2 parents 9232756 + 1015b62 commit a6db05d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/poetry-pytest-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ jobs:

services:
rabbitmq:
image: rabbitmq:3.8
image: rabbitmq:3.12-management
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672
- 15672
etcd:
image: quay.io/coreos/etcd:v3.4.15
ports:
- 2379
- 2380

steps:
#----------------------------------------------
Expand All @@ -36,6 +41,13 @@ jobs:
id: setup-python
with:
python-version: '3.11'

#----------------------------------------------
# setup rabbitmq
#----------------------------------------------
# - name: RabbitMQ Action with mng
# uses: mer-team/[email protected]

#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
Expand Down Expand Up @@ -68,9 +80,10 @@ jobs:
# run test suite and output coverage file
#----------------------------------------------
- name: Test with coverage and pytest
RMQ_AMQP_PORT: ${{ job.services.rabbitmq.ports['5672'] }}
RMQ_API_PORT: ${{ job.services.rabbitmq.ports['15672'] }}
run: poetry run coverage run -m pytest && poetry run coverage xml
env:
RMQ_AMQP_PORT: ${{ job.services.rabbitmq.ports['5672'] }}
RMQ_API_PORT: ${{ job.services.rabbitmq.ports['15672'] }}
#----------------------------------------------
# Upload coverage file to codeconv.io
#----------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ log_cli_date_format = "%d %H:%M:%S"
[tool.coverage.run]
omit = [".*", "*/site-packages/*"]
[tool.coverage.report]
fail_under = 95
fail_under = 80
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:"
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def test_settings():
start_time = datetime.datetime.utcnow()

"""
RMQ_AMQP_PORT: ${{ job.services.rabbitmq.ports['5672'] }}
Parameters in github actions
RMQ_AMQP_PORT: ${{ job.services.rabbitmq.ports['5672'] }}
RMQ_API_PORT: ${{ job.services.rabbitmq.ports['15672'] }}
"""
api_port = os.environ.get("RMQ_API_PORT", 15672)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_service_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

logger = logging.getLogger()


# @pytest.mark.skip
@pytest.mark.asyncio
async def test_rmq_api_service_mode(test_settings, test_rmq_url, test_api_url):
instance_id = uuid4().hex
Expand All @@ -34,7 +34,7 @@ async def test_rmq_api_service_mode(test_settings, test_rmq_url, test_api_url):
port=2379,
),
)
await container.start()
# await container.start()


@pytest.mark.asyncio
Expand Down

0 comments on commit a6db05d

Please sign in to comment.