Skip to content

Commit

Permalink
Merge pull request #12365 from RasaHQ/ATO-1062-Address-ChefBuildError…
Browse files Browse the repository at this point in the history
…-in-the-CI-Pipeline

Fix ChefBuildError in CI
  • Loading branch information
vcidst authored Jun 5, 2023
2 parents 53d5702 + fa023ce commit 461d798
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 72 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ jobs:

- name: Install Dependencies 📦
if: needs.changes.outputs.backend == 'true'
# Poetry intermittently fails to install dependency if it is not PEP 517 compliant
# This is a workaround for that issue
run: |
sudo apt-get -y install libpq-dev
make install-full
make install-full || make install-full || make install-full
- name: Checkout target branch to be able to diff
if: needs.changes.outputs.backend == 'true' && github.event_name == 'pull_request'
Expand Down Expand Up @@ -305,9 +307,11 @@ jobs:

- name: Install Dependencies (Linux) 📦
if: needs.changes.outputs.backend == 'true' && matrix.os == 'ubuntu-22.04'
# Poetry intermittently fails to install dependency if it is not PEP 517 compliant
# This is a workaround for that issue
run: |
sudo apt-get -y install libpq-dev
make install-full | tee .output
make install-full | tee .output || make install-full | tee .output || make install-full | tee .output
if grep 'The lock file is not up to date' .output; then exit 1; fi
make prepare-tests-ubuntu
Expand All @@ -317,14 +321,16 @@ jobs:
# We create symlinks for spacy models, that's why we need to clean them up
# before caching the dependencies directory.
# More information: https://github.com/actions/cache/issues/120
# Poetry intermittently fails to install dependency if it is not PEP 517 compliant
# This is a workaround for that issue
run: |
$spacy_data_dir = ".venv\lib\site-packages\spacy\data"
if (Test-Path $spacy_data_dir) {
Get-ChildItem -Force -ErrorAction Stop $spacy_data_dir | Where-Object { if($_.Attributes -match "ReparsePoint"){$_.Delete()} }
Remove-Item -Force -Recurse $spacy_data_dir
New-Item -Path $spacy_data_dir -Type Directory
}
make install-full
make install-full || make install-full || make install-full
make prepare-tests-windows-gha
- name: Add github workflow problem matchers
Expand Down Expand Up @@ -749,7 +755,7 @@ jobs:

- name: Install poetry 🦄
if: needs.changes.outputs.backend == 'true'
uses: Gr1N/setup-poetry@09236184f6c1ab47c0dc9c1001c7fe200cf2afb0 # v7
uses: Gr1N/setup-poetry@15821dc8a61bc630db542ae4baf6a7c19a994844 # v8
with:
poetry-version: ${{ env.POETRY_VERSION }}

Expand Down
1 change: 1 addition & 0 deletions changelog/12365.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Moved dev-dependencies in `pyproject.toml` to the `dev` group. These depedencies are now in the section `[tool.poetry.group.dev.dependencies]` and run `make install-full` thrice as a workaround for Poetry's problem with PEP 517 non-compliant dependencies (more on it here: https://github.com/python-poetry/poetry/issues/7611)
27 changes: 1 addition & 26 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 34 additions & 36 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -203,42 +203,6 @@ markers = "sys_platform != 'linux' or (platform_machine != 'arm64' and platform_
version = "0.19.0"
markers = "sys_platform == 'linux' and (platform_machine == 'arm64' or platform_machine == 'aarch64')"

[tool.poetry.dev-dependencies]
pytest-cov = "^4.0.0"
pytest-asyncio = "^0.20.0"
pytest-xdist = "^3.2.1"
pytest = "^7.1.3"
freezegun = "^1.0.0"
responses = "^0.22.0"
aioresponses = "^0.7.2"
moto = "~=4.1.2"
fakeredis = "^2.11.2"
mongomock = "^4.1.2"
black = "^22.10.0"
google-cloud-storage = "^2.4.0"
azure-storage-blob = "<12.16.0"
coveralls = "^3.0.1"
towncrier = "^22.8.0"
toml = "^0.10.0"
pep440-version-utils = "^0.3.0"
pydoc-markdown = "^4.5.1"
pytest-timeout = "^2.1.0"
mypy = "^1.0.0"
bandit = "^1.6.3"
types-pytz = "^2022.1.1"
types-python-dateutil = "^2.8.19"
types-requests = "^2.25.0"
types-setuptools = "^67.2.0"
memory-profiler = "^0.61.0"
psutil = "^5.8.0"
mypy-extensions = "^0.4.3"
sanic-testing = ">=21.12.0,<22.9.0"
analytics-python = "^1.4.0"
datadog-api-client = "^2.0.0"
datadog = "^0.45.0"
types-redis = "^4.3.20"
httpx = "0.23.3"

[tool.poetry.extras]
spacy = [ "spacy",]
jieba = [ "jieba",]
Expand Down Expand Up @@ -332,3 +296,37 @@ branch = "fix_signal_issue"
[tool.poetry.group.dev.dependencies]
ruff = "^0.0.255"
docker = "^6.0.1"
pytest-cov = "^4.0.0"
pytest-asyncio = "^0.20.0"
pytest-xdist = "^3.2.1"
pytest = "^7.1.3"
freezegun = "^1.0.0"
responses = "^0.22.0"
aioresponses = "^0.7.2"
moto = "~=4.1.2"
fakeredis = "^2.11.2"
mongomock = "^4.1.2"
black = "^22.10.0"
google-cloud-storage = "^2.4.0"
azure-storage-blob = "<12.16.0"
coveralls = "^3.0.1"
towncrier = "^22.8.0"
toml = "^0.10.0"
pep440-version-utils = "^0.3.0"
pydoc-markdown = "^4.5.1"
pytest-timeout = "^2.1.0"
mypy = "^1.0.0"
bandit = "^1.6.3"
types-pytz = "^2022.1.1"
types-python-dateutil = "^2.8.19"
types-requests = "^2.25.0"
types-setuptools = "^67.2.0"
memory-profiler = "^0.61.0"
psutil = "^5.8.0"
mypy-extensions = "^0.4.3"
sanic-testing = ">=21.12.0,<22.9.0"
analytics-python = "^1.4.0"
datadog-api-client = "^2.0.0"
datadog = "^0.45.0"
types-redis = "^4.3.20"
httpx = "0.23.3"
14 changes: 8 additions & 6 deletions tests/core/test_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,12 @@ async def test_kafka_broker_security_protocols(file: Text, exception: Exception)
producer.list_topics("topic", timeout=1)


@pytest.mark.flaky
async def test_no_pika_logs_if_no_debug_mode(caplog: LogCaptureFixture):
"""
tests that when you run rasa with logging set at INFO,
the debugs from pika dependency are not going to be shown
"""
broker = PikaEventBroker(
"host", "username", "password", retry_delay_in_seconds=1, connection_attempts=1
)
Expand All @@ -313,14 +318,11 @@ async def test_no_pika_logs_if_no_debug_mode(caplog: LogCaptureFixture):
with pytest.raises(Exception):
await broker.connect()

caplog_records = [
record for record in caplog.records if record.name != "ddtrace.internal.writer"
]

# Only Rasa Open Source logs, but logs from the library itself.
assert all(
record.name in ["rasa.core.brokers.pika", "asyncio"]
for record in caplog_records
record.name
in ["rasa.core.brokers.pika", "asyncio", "ddtrace.internal.writer.writer"]
for record in caplog.records
)


Expand Down

0 comments on commit 461d798

Please sign in to comment.