Skip to content

Adding Windows testing #1616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
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
61 changes: 58 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ on:

env:
PACKAGE_NAME: PyMAPDL
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
PYMAPDL_DB_PORT: 21001 # default won't work on GitHub runners
PYMAPDL_START_INSTANCE: FALSE
PYANSYS_OFF_SCREEN: True
DPF_START_SERVER: False
DPF_PORT: 21002
Expand Down Expand Up @@ -119,6 +116,10 @@ jobs:
docs_build:
name: Build Documentation
runs-on: ubuntu-latest
env:
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
PYMAPDL_DB_PORT: 21001 # default won't work on GitHub runners
PYMAPDL_START_INSTANCE: FALSE

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -306,6 +307,10 @@ jobs:
strategy:
matrix:
mapdl-version: ['v21.1.1', 'v21.2.1', 'v22.1.0', 'v22.2.0', 'v22.2-ubuntu']
env:
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
PYMAPDL_DB_PORT: 21001 # default won't work on GitHub runners
PYMAPDL_START_INSTANCE: FALSE

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -447,6 +452,56 @@ jobs:
if compgen -G './logs-${{ matrix.mapdl-version }}/*.log' > /dev/null ;then for f in ./logs-${{ matrix.mapdl-version }}/*.log; do echo "::group:: Log file $f" && cat $f && echo "::endgroup::" ; done; fi
if compgen -G './logs-${{ matrix.mapdl-version }}/*.out' > /dev/null ;then for f in ./logs-${{ matrix.mapdl-version }}/*.out; do echo "::group:: Output file $f" && cat $f && echo "::endgroup::" ; done; fi

test_windows:
name: Unit Testing on Windows
runs-on: [self-hosted, Windows, pymapdl]

steps:
- uses: actions/checkout@v3

# - name: Setup Python
# uses: actions/[email protected]
# with:
# python-version: 3.9

- name: Checking python_
shell: powershell
run: |
python -m pip install --upgrade pip

- name: Creating python venv
run: |
python -m venv .\.venv
.\.venv\Scripts\activate

- name: Install ansys-mapdl-core
shell: powershell
run: |
python -m pip install build
python -m build
$FILE_=Resolve-Path '.\dist\*.whl'
python -m pip install $FILE_.Path --upgrade
python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"

- name: Unit Testing Requirements Installation
shell: powershell
run: |
python -m pip install .[tests]

# - name: DPF Server Activation
# run: |
# docker pull ghcr.io/pyansys/dpf-core:22.2dev
# docker run -d --name dpfserver -p ${{ env.DPF_PORT }}:50052 ghcr.io/pyansys/dpf-core:22.2dev && echo "DPF Server active on port ${{ env.DPF_PORT }}."

- name: Unit Testing
run: |
set PYMAPDL_PORT=
set PYMAPDL_START_INSTANCE=
python -m pytest -v -k "not test_database and not test_dpf" --durations=10 --maxfail=10 --reruns 7 --reruns-delay 3 --only-rerun MapdlExitedError --cov=ansys.mapdl.core --cov-report=xml --cov-report=html

- uses: codecov/codecov-action@v3
name: 'Upload coverage to Codecov'

Release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [docs_build, build_test]
Expand Down
10 changes: 6 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
import os
from pathlib import Path
import signal
import time

from common import Element, Node, get_details_of_elements, get_details_of_nodes
import pytest

# import time


pytest_plugins = ["pytester"]

import pyvista
Expand Down Expand Up @@ -306,9 +308,9 @@ def mapdl(request, tmpdir_factory):
mapdl._send_command_stream("/PREP7")

# verify PIDs are closed
time.sleep(1) # takes a second for the processes to shutdown
for pid in mapdl._pids:
assert not check_pid(pid)
# time.sleep(1) # takes a second for the processes to shutdown
# for pid in mapdl._pids:
# assert not check_pid(pid)


@pytest.fixture
Expand Down