From 974a485c4e099c62ac0303effa7940bd41c72d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@ericsson.com> Date: Mon, 2 Sep 2024 12:52:54 +0200 Subject: [PATCH] fixed tests --- .gitlab-ci.yml | 1 + CONTRIBUTING.md | 10 ++++++++-- docker-compose.yml | 6 +++++- setup.py | 3 --- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca75d28..34fbc45 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,6 +33,7 @@ unittest: - coverage run --append -m compile_definitions script: - coverage run --append -m nose2 -F -vv + - COOLAMQP_FORCE_SELECT_LISTENER=1 coverage run --append -m nose2 -F -vv after_script: - mv .coverage .coverage.units variables: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fc87545..20e2f43 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,10 +4,16 @@ 1.1. If it's cool af, you don't have to. 2. Exhaustive pydoc. 3. If you introduce any gotchas, document them in [docs/](docs/). - +4. We aim to support Python 2.7 as long as possible, keep that in account. ## Unit tests -Tests work using either Travis CI or Vagrant. +Tests work using docker-compose. + +Just +```bash +docker-compose up --build unittest +docker-compose up --build stress_tests +``` If you want to debug things, you have RabbitMQ management enabled on Vagrant. Go to [http://127.0.0.1:15672](http://127.0.0.1:15672) and log in with **user** / **user** diff --git a/docker-compose.yml b/docker-compose.yml index 812b4ef..741ac5b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,15 @@ version: '3.2' services: amqp: - image: rabbitmq + image: rabbitmq:3-management unittest: build: context: . dockerfile: tests/Dockerfile depends_on: - amqp + environment: + AMQP_HOST: "amqp" stress_tests: build: context: . @@ -15,3 +17,5 @@ services: command: python -m stress_tests depends_on: - amqp + environment: + AMQP_HOST: "amqp" diff --git a/setup.py b/setup.py index d39cc73..00144ae 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python -# coding=UTF-8 from setuptools import setup, find_packages from coolamqp import __version__ @@ -8,7 +6,6 @@ setup(keywords=['amqp', 'rabbitmq', 'client', 'network', 'ha', 'high availabilit version=__version__, packages=find_packages(include=['coolamqp', 'coolamqp.*']), install_requires=['six'], - # per coverage version for codeclimate-reporter tests_require=["pytest", "coverage"], test_suite='nose2.collector.collector', python_requires='!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*', -- GitLab