From cb15d91be54c2878bed0df5d5b70f96bb482de7d Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Wed, 17 May 2017 22:32:32 +0200 Subject: [PATCH 1/6] fix readme links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6efd97e..27b3b32 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # FA Forever - IRC bot -[![Build Status](https://travis-ci.org/FAForever/fafbot.svg?branch=master)](https://travis-ci.org/FAForever/fafbot) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/FAForever/fafbot/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/FAForever/fafbot/?branch=master) +[![Build Status](https://travis-ci.org/FAForever/QAI.svg?branch=master)](https://travis-ci.org/FAForever/QAI) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/FAForever/QAI/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/FAForever/QAI/?branch=master) This is the source code for the [Forged Alliance Forever](http://www.faforever.com/) IRC bot. From 280a1eee79bfa95e9d0b9fbe3405d41cce446ed9 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Wed, 17 May 2017 22:32:32 +0200 Subject: [PATCH 2/6] add Dockerfile --- Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..65f0b03 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.5 + +RUN pip install --upgrade pip +RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +COPY requirements.txt /tmp/requirements.txt + +RUN pip install --upgrade --trusted-host content.dev.faforever.com -r /tmp/requirements.txt + +RUN cat /config/config.ini + +CMD irc3 /config/config.ini \ No newline at end of file From afb2b398c8cb85d549db41cf5e8b4798e7f02af3 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Thu, 18 May 2017 23:27:50 +0200 Subject: [PATCH 3/6] pin all versions to prevent unexpected issues on rebuilding as a docker container --- requirements.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 8bd4731..0675318 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -aiohttp -aiomysql -configobj -irc3 -pytest -slackclient -websockets \ No newline at end of file +aiohttp==2.0.7 +aiomysql==0.0.9 +configobj==5.0.6 +irc3==1.0.0 +pytest==3.0.7 +slackclient==1.0.5 +websockets==3.3 \ No newline at end of file From 5e1d288d9381504c2fad218e4504683bc8d5feae Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Thu, 18 May 2017 23:34:55 +0200 Subject: [PATCH 4/6] remove unused requirements --- requirements.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0675318..4f63652 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,4 @@ aiohttp==2.0.7 -aiomysql==0.0.9 -configobj==5.0.6 irc3==1.0.0 pytest==3.0.7 -slackclient==1.0.5 -websockets==3.3 \ No newline at end of file +slackclient==1.0.5 \ No newline at end of file From efa759ae5bd23b1d4c33be9f41045189b9143a36 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Thu, 18 May 2017 23:46:21 +0200 Subject: [PATCH 5/6] fix travis fails (introduce some simple tests) --- .travis.yml | 5 ++--- tests/__init__.py | 0 tests/test_links.py | 9 +++++++++ tests/test_taunts.py | 7 +++++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 tests/__init__.py create mode 100644 tests/test_links.py create mode 100644 tests/test_taunts.py diff --git a/.travis.yml b/.travis.yml index a1cca5e..144ec85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,10 @@ language: python python: - - "2.7" + - "3.5" install: - - cp fafbot.conf.example fafbot.conf - - wget https://raw.githubusercontent.com/FAForever/server/develop/passwords.py.example -O passwords.py + - cp config.ini.example config.ini - pip install -r requirements.txt - pip install pytest-cov python-coveralls diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_links.py b/tests/test_links.py new file mode 100644 index 0000000..7532608 --- /dev/null +++ b/tests/test_links.py @@ -0,0 +1,9 @@ +from links import LINKS, LINKS_SYNONYMES, WIKI_LINKS, WIKI_LINKS_SYNONYMES, OTHER_LINKS + + +def test_existance(): + assert isinstance(LINKS, dict) + assert isinstance(LINKS_SYNONYMES, dict) + assert isinstance(WIKI_LINKS, dict) + assert isinstance(WIKI_LINKS_SYNONYMES, dict) + assert isinstance(OTHER_LINKS, dict) diff --git a/tests/test_taunts.py b/tests/test_taunts.py new file mode 100644 index 0000000..d637683 --- /dev/null +++ b/tests/test_taunts.py @@ -0,0 +1,7 @@ +from taunts import TAUNTS, SPAM_PROTECT_TAUNTS, KICK_TAUNTS + + +def test_existance(): + assert isinstance(TAUNTS, list) + assert isinstance(SPAM_PROTECT_TAUNTS, list) + assert isinstance(KICK_TAUNTS, list) From 5817e717ffee4ad50093ec3219fd8c73d535e460 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Tue, 23 May 2017 23:04:50 +0200 Subject: [PATCH 6/6] fix the Dockerfile (irc3 config madness) --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 65f0b03..3994ebb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,10 @@ COPY requirements.txt /tmp/requirements.txt RUN pip install --upgrade --trusted-host content.dev.faforever.com -r /tmp/requirements.txt -RUN cat /config/config.ini +ADD . /code/ +WORKDIR /code/ -CMD irc3 /config/config.ini \ No newline at end of file +VOLUME /config + +# irc3 searches for the plugin files in the folder of the configuration file +CMD cp /config/config.ini ./config.ini && irc3 config.ini \ No newline at end of file