Skip to content

Commit 3d003bc

Browse files
committed
demo add tests coverage report.
1 parent c7cf8b5 commit 3d003bc

File tree

6 files changed

+32
-20
lines changed

6 files changed

+32
-20
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ ENV PATH="/tmp/venv/bin:${PATH}"
1010
RUN pip install --upgrade pip
1111
RUN pip install --upgrade pip-tools
1212
RUN pip install --upgrade setuptools
13+
RUN pip install --upgrade coverage
1314
RUN pip install -r requirements/requirements.dev.txt --no-index --find-links ./vendor/

Dockerfile.selenium

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
FROM selenium/standalone-chrome
2-
3-
ENV PYTHONUNBUFFERED 1
4-
USER root
5-
RUN apt-get update ; apt-get install -yq git curl libpq-dev libffi-dev
6-
RUN apt-get update ; apt-get install -yq python3 python3-venv
7-
RUN ln -s /usr/bin/python3 /usr/local/bin/python
8-
RUN useradd -m -s /bin/bash DEV
9-
USER DEV
10-
ADD . /code
11-
WORKDIR /code
12-
RUN python -m venv /tmp/venv
13-
RUN . /tmp/venv/bin/activate
14-
ENV PATH="/tmp/venv/bin:${PATH}"
15-
RUN pip3 install --upgrade pip
16-
RUN pip3 install selenium pytest jsonschema
17-
1+
FROM seleniarm/standalone-chromium
2+
3+
ENV PYTHONUNBUFFERED 1
4+
USER root
5+
RUN apt-get update ; apt-get install -yq git curl libpq-dev libffi-dev
6+
RUN apt-get update ; apt-get install -yq python3 python3-venv
7+
RUN ln -s /usr/bin/python3 /usr/local/bin/python
8+
RUN useradd -m -s /bin/bash DEV
9+
USER DEV
10+
ADD . /code
11+
WORKDIR /code
12+
RUN python -m venv /tmp/venv
13+
RUN . /tmp/venv/bin/activate
14+
ENV PATH="/tmp/venv/bin:${PATH}"
15+
RUN pip3 install --upgrade pip
16+
RUN pip3 install selenium pytest jsonschema
17+

Jenkinsfiles/Jenkinsfile.cbc-run-multi-pr-checks-w-selenium

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pipeline {
5757
. venv/bin/activate
5858
make reqs-download
5959
make reqs-install-dev
60+
pip install --upgrade coverage
6061
"""
6162
}
6263
}
@@ -74,7 +75,7 @@ pipeline {
7475
steps{
7576
sh """
7677
. venv/bin/activate
77-
python runtests.py
78+
coverage run runtests.py && coverage report -m
7879
"""
7980
}
8081
}

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,12 @@ services:
6363
- .:/code
6464
profiles:
6565
- tests
66+
tests:
67+
build: .
68+
command: bash -c "coverage run runtests.py && coverage report -m"
69+
env_file:
70+
- docker-compose/unittests-env-vars.env
71+
volumes:
72+
- .:/code
73+
profiles:
74+
- coverage

docker-compose/run_integration_tests_local.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ else
244244
pip install -r requirements/requirements.txt \
245245
--no-index --find-links ./vendor/; \
246246
pip install sqlparse; \
247-
python runtests.py --integration ${INTEGRATION_TESTS_LIST}"
247+
coverage run runtests.py --integration ${INTEGRATION_TESTS_LIST}; \
248+
coverage report -m"
248249
fi
249250
fi
250251

docker-compose/run_selenium_tests_remote.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ SYSTEM=$(uname -s)
102102
echo "USE_NEW_PERM_SCREEN=" ${USE_NEW_PERM_SCREEN}
103103
echo "BB2 Server URL=" ${HOSTNAME_URL}
104104

105-
export USE_NEW_PERM_SCREEN
105+
## export USE_NEW_PERM_SCREEN
106106
export USE_MSLSX=false
107107

108108
# stop all before run selenium remote tests

0 commit comments

Comments
 (0)