Skip to content
Open
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
67 changes: 60 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
version: 2
version: 2.1

orbs:
browser-tools: circleci/browser-tools@1.4.0

executors:
default:
working_directory: /home/circleci/workspace
docker:
- image: cimg/python:3.8-browsers

jobs:
build:
working_directory: /home/circleci/workspace/
docker:
- image: circleci/python:3.8-browsers
executor: default
steps:
- checkout
- restore_cache:
key: deps-{{ checksum "pyproject.toml" }}
paths:
- .
- run:
name: "Install Browserstack tools"
command: |
Expand All @@ -16,13 +28,45 @@ jobs:
- run:
name: "Install Python Dependencies"
command: |
poetry config virtualenvs.in-project true
poetry install
- save_cache:
key: deps-{{ checksum "pyproject.toml" }}
paths:
- .
- persist_to_workspace:
root: /home/circleci
paths:
- .
unit-test:
executor: default
steps:
- attach_workspace:
at: /home/circleci
- run:
name: "Code Style Check"
command: |
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
poetry run black --check --line-length=88 --safe src tests
- run:
name: "Run Tests"
command: |
mkdir /home/circleci/reports/
poetry run pytest --verbose --cov arsenic --cov-report html:/home/circleci/reports/coverage/ --junitxml /home/circleci/reports/junit.xml --ignore tests/test_real_browsers.py
- store_test_results:
path: /home/circleci/reports/junit.xml
- store_artifacts:
path: /home/circleci/reports/coverage/
environment:
- DOCS_DIR: "/home/circleci/workspace/docs/"
browser-test:
unit:
executor: default
steps:
- attach_workspace:
at: /home/circleci
- browser-tools/install-browser-tools
- run:
name: "Run Tests"
command: |
Expand All @@ -31,10 +75,19 @@ jobs:
export REMOTE_BROWSER="{\"bstack:options\": {\"os\": \"Windows\", \"osVersion\": \"10\", \"resolution\": \"1024x768\", \"local\": \"true\", \"seleniumVersion\": \"3.14.0\", \"localIdentifier\": \"${CIRCLE_SHA1}\", \"buildName\": \"${CIRCLE_SHA1}-${CIRCLE_BUILD_NUM}-Chrome\", \"projectName\": \"arsenic\"}, \"browserName\": \"Chrome\", \"browserVersion\": \"latest\"}"
export BROWSERSTACK_LOCAL_IDENTIFIER="${CIRCLE_SHA1}"
export BROWSERSTACKLOCAL_BINARY="/home/circleci/bin/BrowserStackLocal"
poetry run pytest --verbose --cov arsenic --cov-report html:/home/circleci/reports/coverage/ --junitxml /home/circleci/reports/junit.xml
poetry run pytest --verbose --cov arsenic --cov-report html:/home/circleci/reports/coverage/ --junitxml /home/circleci/reports/junit.xml tests/test_real_browsers.py
- store_test_results:
path: /home/circleci/reports/junit.xml
- store_artifacts:
path: /home/circleci/reports/coverage/
environment:
- DOCS_DIR: "/home/circleci/workspace/docs/"

workflows:
build_and_test:
jobs:
- build
- unit-test:
requires:
- build
- browser-test:
requires:
- build