Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows testing support for Rasa #5784

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ jobs:

test:
name: Run Tests
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 2
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.6, 3.7]

steps:
Expand Down Expand Up @@ -142,15 +143,32 @@ jobs:
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-${{ matrix.python-version }}

- name: Install Dependencies 📦
- name: Install Dependencies (Linux) 📦
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get -y install libpq-dev
make install-full | tee .output
if grep 'The lock file is not up to date' .output; then exit 1; fi
make prepare-tests-ubuntu

- name: Install Dependencies (Windows) 📦
if: matrix.os == 'windows-latest'
run: |
make install-full-windows
make prepare-tests-windows

- name: Test Code 🔍
run: JOBS=2 make test
if: matrix.os == 'ubuntu-latest'
env:
JOBS: 2
run: make test

- name: Test Code (Windows) 🔍
if: matrix.os == 'windows-latest'
env:
JOBS: 2
PYTHONIOENCODING: "utf-8"
run: make test-windows

- name: Send Coverage Report 📊
if: matrix.python-version == 3.6
Expand Down
25 changes: 23 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ help:
@echo " Remove Python/build artifacts."
@echo " install"
@echo " Install rasa."
@echo " install-full"
@echo " Install rasa with all extras (transformers, tensorflow_text, spacy, jieba)."
@echo " formatter"
@echo " Apply black formatting to code."
@echo " lint"
Expand All @@ -18,11 +20,16 @@ help:
@echo " Install system requirements for running tests on Ubuntu and Debian based systems."
@echo " prepare-tests-macos"
@echo " Install system requirements for running tests on macOS."
@echo " prepare-tests-windows"
@echo " Install system requirements for running tests on Windows."
@echo " prepare-tests-files"
@echo " Download all additional project files needed to run tests."
@echo " test"
@echo " Run pytest on tests/."
@echo " Use the JOBS environment variable to configure number of workers (default: 1)."
@echo " test-windows"
@echo " Run pytest on tests/ on Windows."
@echo " Use the JOBS environment variable to configure number of workers (default: 1)."
@echo " doctest"
@echo " Run all doctests embedded in the documentation."
@echo " livedocs"
Expand All @@ -49,6 +56,10 @@ install-mitie:
install-full: install install-mitie
poetry install -E full

install-full-windows: install install-mitie
# because tensorflow_text is not available on Windows
poetry install -E spacy -E transformers -E jieba

formatter:
poetry run black rasa tests

Expand All @@ -60,7 +71,7 @@ types:
poetry run pytype --keep-going rasa -j 16

prepare-tests-files:
poetry install --extras spacy
poetry install -E spacy
poetry run python -m spacy download en_core_web_md
poetry run python -m spacy download de_core_news_sm
poetry run python -m spacy link en_core_web_md en --force
Expand All @@ -70,16 +81,26 @@ prepare-tests-files:
prepare-wget-macos:
brew install wget || true

prepare-wget-windows:
choco install wget

prepare-tests-macos: prepare-wget-macos prepare-tests-files
brew install graphviz || true

prepare-tests-ubuntu: prepare-tests-files
sudo apt-get -y install graphviz graphviz-dev python-tk

prepare-tests-windows: prepare-wget-windows prepare-tests-files
choco install graphviz

test: clean
# OMP_NUM_THREADS can improve overral performance using one thread by process (on tensorflow), avoiding overload
# OMP_NUM_THREADS can improve overrall performance using one thread by process (on tensorflow), avoiding overload
OMP_NUM_THREADS=1 poetry run pytest tests -n $(JOBS) --cov rasa

test-windows: clean
# OMP_NUM_THREADS can improve overrall performance using one thread by process (on tensorflow), avoiding overload
OMP_NUM_THREADS=1 poetry run pytest tests -n $(JOBS) -m "not unix" --cov rasa

doctest: clean
cd docs && poetry run make doctest

Expand Down
2 changes: 2 additions & 0 deletions changelog/5637.enhancement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added behavior to the ``rasa --version`` command. It will now also list information about the operating system,
python version and rasa-sdk. This will make it easier for users to file bug reports.
1 change: 1 addition & 0 deletions changelog/5784.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added testing of Rasa Open Source installations on Windows.
Loading