From 66f8712745263b56b6348c39675cd1d66c059893 Mon Sep 17 00:00:00 2001 From: chenchienjacklin <104948990+chenchienjacklin@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:38:39 -0800 Subject: [PATCH] FEATURE: Enable end to end testing --- .github/workflows/ci_cd.yml | 22 ++++++++++++++++++++++ tox.ini | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index fb76358685..30051ef9fe 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -13,6 +13,7 @@ env: PACKAGE_NAME: 'ansys-edb-core' DOCUMENTATION_CNAME: 'edb.core.docs.pyansys.com' MAIN_PYTHON_VERSION: '3.10' + ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -80,6 +81,27 @@ jobs: # Only the tox environment specified in the tox.ini gh-actions is run run: tox -e test -- --ignore=tests/e2e + tests-e2e: + name: End to end tests and coverage + runs-on: [ self-hosted, Windows, pyedb-core ] + if: startsWith(github.event.pull_request.base.ref, 'release') + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade .[tests] + python -m pip install --upgrade tox-gh-actions + + - name: Test with tox + # Only the tox environment specified in the tox.ini gh-actions is run + run: tox -e test -- tests/e2e + doc-build: name: "Doc build" runs-on: ubuntu-latest diff --git a/tox.ini b/tox.ini index eb66cec3d9..881b4909dd 100644 --- a/tox.ini +++ b/tox.ini @@ -30,9 +30,11 @@ install_command = description = Checks for project unit tests setenv = PYTEST_EXTRA_ARGS = --junitxml=junit/test-results.xml + ANSYSEM_EDB_EXE_DIR = {env:ANSYSEM_ROOT251} + ANSYSLMD_LICENSE_FILE = {env:ANSYSLMD_LICENSE_FILE} commands = python -m pip install .[tests] - pytest {posargs} {env:PYTEST_EXTRA_ARGS:} + pytest {posargs} {env:PYTEST_EXTRA_ARGS:ANSYSEM_EDB_EXE_DIR:ANSYSLMD_LICENSE_FILE} [testenv:coverage] description = Checks for project unit tests and coverage