Skip to content

Commit 01a5a60

Browse files
Merge pull request #40 from scivisum/circleci-project-setup
Circleci project setup
2 parents 4f11f7d + 79b000a commit 01a5a60

File tree

13 files changed

+108
-56
lines changed

13 files changed

+108
-56
lines changed

.circleci/config.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
version: 2.1
2+
3+
jobs:
4+
unittests-py38:
5+
docker:
6+
- image: python:3.8.16-bullseye
7+
steps:
8+
- run: git config --global --add safe.directory /tmp/_circleci_local_build_repo
9+
- checkout
10+
- run: pip install -r dev_requirements.txt
11+
- run: pytest tests/unittests --verbose --full-trace
12+
unittests-py311:
13+
docker:
14+
- image: python:3.11.3-bullseye
15+
steps:
16+
- run: git config --global --add safe.directory /tmp/_circleci_local_build_repo
17+
- checkout
18+
- run: pip install -r dev_requirements.txt
19+
- run: pytest tests/unittests --verbose --full-trace
20+
integrationtests-py38:
21+
docker:
22+
- image: python:3.8.16-bullseye
23+
steps:
24+
- run: git config --global --add safe.directory /tmp/_circleci_local_build_repo
25+
- checkout
26+
- run: pip install -r dev_requirements.txt
27+
- run: pytest tests/integrationtests --verbose --full-trace
28+
integrationtests-py311:
29+
docker:
30+
- image: python:3.11.3-bullseye
31+
steps:
32+
- run: git config --global --add safe.directory /tmp/_circleci_local_build_repo
33+
- checkout
34+
- run: pip install -r dev_requirements.txt
35+
- run: pytest tests/integrationtests --verbose --full-trace
36+
e2etests-chrome106-py38:
37+
docker:
38+
- image: matseymour/chrome-python:106.0.5249.61-3.8.16
39+
steps:
40+
- run: git config --global --add safe.directory /tmp/_circleci_local_build_repo
41+
- checkout
42+
- run: pip install -r dev_requirements.txt
43+
- run: tini -s -- xvfb-run pytest tests/e2etests --verbose --full-trace
44+
e2etests-chrome112-py311:
45+
docker:
46+
- image: matseymour/chrome-python:112.0.5615.121-3.11.3
47+
steps:
48+
- run: git config --global --add safe.directory /tmp/_circleci_local_build_repo
49+
- checkout
50+
- run: pip install -r dev_requirements.txt
51+
- run: tini -s -- xvfb-run pytest tests/e2etests --verbose --full-trace
52+
workflows:
53+
test:
54+
jobs:
55+
- unittests-py38
56+
- unittests-py311
57+
- integrationtests-py38
58+
- integrationtests-py311
59+
- e2etests-chrome106-py38
60+
- e2etests-chrome112-py311

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

Dockerfile-106-3.8

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM matseymour/chrome-python:106.0.5249.61-3.8.16
2+
ENV PYTHONUNBUFFERED 1
3+
4+
RUN mkdir /code
5+
RUN mkdir /code/tests
6+
RUN mkdir /code/browserdebuggertools
7+
COPY dev_requirements.txt /code
8+
RUN pip install -r /code/dev_requirements.txt
9+
10+
WORKDIR /code/tests

Dockerfile-112-3.11

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM matseymour/chrome-python:112.0.5615.121-3.11.3
2+
ENV PYTHONUNBUFFERED 1
3+
4+
RUN mkdir /code
5+
RUN mkdir /code/tests
6+
RUN mkdir /code/browserdebuggertools
7+
COPY dev_requirements.txt /code
8+
RUN pip install -r /code/dev_requirements.txt
9+
10+
WORKDIR /code/tests

dev_requirements.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
requests
2-
mock
3-
typing
4-
jinja2
5-
websocket-client==0.56
6-
cherrypy==17.4.2
1+
requests==2.29.0
2+
jinja2==3.1.2
3+
pytest==7.3.1
4+
websocket-client==1.5.1
5+
cherrypy==18.8.0

scripts/travis.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
classifiers=[
2727
'Intended Audience :: Developers',
2828
"Programming Language :: Python",
29-
"Programming Language :: Python :: 3.8",
29+
"Programming Language :: Python :: 3",
3030
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
3131
"Operating System :: OS Independent"
3232
],

test.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
images=$(docker image list)
3+
for VERS in "106-3.8" "112-3.11"
4+
do
5+
matches=$(echo "$images" |grep browser-debugger-tools-test:$VERS)
6+
echo "########### Testing Dockerfile-$VERS ###########"
7+
if [ "$1" == "--build" ] || [ "$matches" == "" ]; then
8+
docker build -f Dockerfile-$VERS -t browser-debugger-tools-test:$VERS .
9+
fi
10+
done
11+
for VERS in "106-3.8" "112-3.11"
12+
do
13+
docker run -v $PWD/tests:/code/tests -v $PWD/browserdebuggertools:/code/browserdebuggertools \
14+
browser-debugger-tools-test:$VERS tini -- xvfb-run pytest .
15+
done

tests/e2etests/chrome/test_interface.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ def setUpClass(cls):
4444
"--no-default-browser-check",
4545
"--headless" if cls.headless else "",
4646
"--user-data-dir=%s" % cls.browser_cache_dir,
47-
"--no-first-run",
47+
"--no-first-run", "--disable-gpu",
48+
"--no-sandbox", "--remote-allow-origins=*"
4849
])
4950

5051
start = time.time()
51-
while start - time.time() < 30:
52+
while time.time() - start < 30:
5253

5354
time.sleep(3)
5455

tests/integrationtests/chrome/test_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from unittest import TestCase
55
from base64 import b64encode
66

7-
from mock import MagicMock, patch
7+
from unittest.mock import MagicMock, patch
88

99
from browserdebuggertools.chrome.interface import ChromeInterface
1010
from browserdebuggertools.exceptions import DevToolsTimeoutException

0 commit comments

Comments
 (0)