rmm commited on
Commit
3a39a18
·
1 Parent(s): f6f632c

CI: new action to run visual tests

Browse files

- setup with manual trigger, seems to work in local container - one step
at a time

.github/workflows/python-pycov-onPR.yml CHANGED
@@ -27,7 +27,7 @@ jobs:
27
  # note this will run all non-visual tests, including the slow end2end ones
28
  # - this action is only on PR; the slow ones are skipped on push.
29
  run: |
30
- pytest -m "not visual" --ignore=tests/visual_selenium --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src tests/ | tee pytest-coverage.txt
31
  echo "working dir:" && pwd
32
  echo "files in cwd:" && ls -ltr
33
 
@@ -38,4 +38,4 @@ jobs:
38
  junitxml-path: ./pytest.xml
39
 
40
  #- name: Comment coverage
41
- # uses: coroo/[email protected]
 
27
  # note this will run all non-visual tests, including the slow end2end ones
28
  # - this action is only on PR; the slow ones are skipped on push.
29
  run: |
30
+ pytest -s -m "not visual" --ignore=tests/visual_selenium --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src tests/ | tee pytest-coverage.txt
31
  echo "working dir:" && pwd
32
  echo "files in cwd:" && ls -ltr
33
 
 
38
  junitxml-path: ./pytest.xml
39
 
40
  #- name: Comment coverage
41
+ # uses: coroo/[email protected]
.github/workflows/python-visualtests.yml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Visual tests of the app
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ #push:
6
+ # branches: [ "dev" ]
7
+ #pull_request:
8
+ # branches: [ "dev", "main" ]
9
+
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ test:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Set up Python 3.10
20
+ uses: actions/setup-python@v3
21
+ with:
22
+ python-version: "3.10"
23
+
24
+
25
+ - name: install chrome
26
+ run: |
27
+ apt-get install -y wget
28
+ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
29
+ && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
30
+ apt-get update && apt-get -y install google-chrome-stable
31
+
32
+ - name: Install py dependencies
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
36
+ if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
37
+ if [ -f tests/visual_selenium/requirements_visual.txt ]; then pip install -r tests/visual_selenium/requirements_visual.txt; fi
38
+
39
+ - name: Check the console scripts interface
40
+ run: |
41
+ seleniumbase
42
+ sbase
43
+ - name: Install chromedriver
44
+ run: |
45
+ seleniumbase install chromedriver
46
+
47
+
48
+
49
+ - name: Run visual tests with pytest
50
+ # we use --demo to make it slow enough (selenium doesn't wait long enough
51
+ # otherwise, not one step it consistently fails at.)
52
+ run: |
53
+ pytest -m "visual" --strict-markers tests/visual_selenium/ -s --demo