Skip to content

Commit

Permalink
merge testing GH workflows; small test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eimrek committed Jul 11, 2024
1 parent 6236d68 commit 95c28f3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 67 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/screenshot-comparison.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: screenshot comparison
name: Screenshot comparison

on:
push:
Expand Down Expand Up @@ -31,19 +31,28 @@ jobs:
pip install --upgrade voila
pip install --upgrade voila-osscar-template
pip install -e .
pip install --upgrade selenium
pip install --upgrade Pillow

- name: Run the voila server
run: |
voila --template=osscar --enable_nbextensions=True example/ --port 8383 --no-browser &
pip install --upgrade pytest
pip install --upgrade selenium
pip install --upgrade Pillow
- uses: nanasess/setup-chromedriver@master
- run: |
- name: Generate the screenshots
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
python3 $GITHUB_WORKSPACE/test/test.py
- name: Upload screenshots
uses: actions/upload-artifact@v4
with:
name: artifact
path: './*.png'

- name: Compare the screenshots to the reference one
run: |
python3 $GITHUB_WORKSPACE/test/test_figures.py
53 changes: 0 additions & 53 deletions .github/workflows/widget-test.yml

This file was deleted.

10 changes: 3 additions & 7 deletions test/test.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# Generated by Selenium IDE
import pytest
import time
import json
import os
import time

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities


class test_widget():
def setup_method(self, method):
Expand Down
4 changes: 2 additions & 2 deletions test/test_figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
stat = ImageStat.Stat(diff)

if sum(stat.mean) == 0:
print('images are the same')
print('Images are the same!')
else:
raise Exception("The result is NOT the same as expected. Please check matplotlib version.")
raise Exception("The result is NOT the same as expected.")

0 comments on commit 95c28f3

Please sign in to comment.