Skip to content

Commit

Permalink
test new
Browse files Browse the repository at this point in the history
  • Loading branch information
proy30 committed Nov 25, 2024
1 parent 11a5c95 commit 364e20d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ jobs:
run: |
.github/workflows/dependencies/gcc-openmpi.sh
python3 -m pip install -U pybind11-stubgen
python3 -m pip install seleniumbase pytest
# Added: Install Firefox and geckodriver
- name: Install Browser Dependencies
run: |
sudo apt-get update
sudo apt-get install -y firefox-esr xvfb
wget https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux64.tar.gz
tar -xzf geckodriver-v0.33.0-linux64.tar.gz
sudo mv geckodriver /usr/local/bin/
sudo chmod +x /usr/local/bin/geckodriver
# Added: Start virtual display
- name: Start Virtual Display
run: |
Xvfb :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Set Up Cache
uses: actions/cache@v4
Expand Down Expand Up @@ -81,7 +98,8 @@ jobs:
- name: Unit tests
run: |
mpiexec -np 1 python3 -m pytest tests/python/
export DISPLAY=:99
mpiexec -np 1 python3 -m pytest -v tests/python/
- uses: stefanzweifel/git-auto-commit-action@v5
name: Commit Updated Stub Files
Expand Down
9 changes: 9 additions & 0 deletions tests/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ file(MAKE_DIRECTORY ${pytest_rundir})
file(COPY ${ImpactX_SOURCE_DIR}/examples
DESTINATION ${pytest_rundir})

file(COPY ${ImpactX_SOURCE_DIR}/src/python/impactx/dashboard
DESTINATION ${pytest_rundir})

# run
add_test(NAME ${pytest_name}
COMMAND ${Python_EXECUTABLE} -m pytest -s -vvvv
Expand All @@ -22,3 +25,9 @@ set_property(TEST ${pytest_name} APPEND PROPERTY ENVIRONMENT "OMP_NUM_THREADS=2"

# set PYTHONPATH and PATH (for .dll files)
impactx_test_set_pythonpath(${pytest_name})

# Add environment variables needed for dashboard tests
set_property(TEST ${pytest_name} APPEND PROPERTY ENVIRONMENT
"DISPLAY=:99"
"PYTHONPATH=${pytest_rundir}:$ENV{PYTHONPATH}"
)

0 comments on commit 364e20d

Please sign in to comment.