From 76486d3ca63559a4ca157ef632ba1a7de9f8bafe Mon Sep 17 00:00:00 2001 From: liamhuber Date: Tue, 28 Nov 2023 13:47:10 -0800 Subject: [PATCH 1/3] Discover tests in a path instead of changing directory I expect this to hang indefinitely and ultimately fail with `ModuleNotFoundError`, if my experience in pyiron_workflow is anything to go by. --- .github/workflows/unittest_by_path.yml | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/unittest_by_path.yml diff --git a/.github/workflows/unittest_by_path.yml b/.github/workflows/unittest_by_path.yml new file mode 100644 index 00000000..2245526c --- /dev/null +++ b/.github/workflows/unittest_by_path.yml @@ -0,0 +1,45 @@ +# This workflow is used to run the unittest of pyiron + +name: Unittests-openmpi + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + include: + + - operating-system: ubuntu-latest + python-version: '3.11' + label: linux-64-py-3-11-openmpi + prefix: /usr/share/miniconda3/envs/my-env + + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2.2.0 + with: + python-version: ${{ matrix.python-version }} + mamba-version: "*" + channels: conda-forge + miniforge-variant: Mambaforge + channel-priority: strict + auto-update-conda: true + environment-file: .ci_support/environment-openmpi.yml + - name: Test + shell: bash -l {0} + timeout-minutes: 5 + run: | + pip install versioneer[toml]==0.29 + pip install . --no-deps --no-build-isolation + python -m unittest discover tests + env: + OMPI_MCA_plm: 'isolated' + OMPI_MCA_rmaps_base_oversubscribe: 'yes' + OMPI_MCA_btl_vader_single_copy_mechanism: 'none' From c431ba783672943e2ed6671844f2b347c7228495 Mon Sep 17 00:00:00 2001 From: liamhuber Date: Tue, 28 Nov 2023 13:54:17 -0800 Subject: [PATCH 2/3] Attempt to resolve the expected path problem I'm not sure either of these will work, but both follow the idea of making sure that the global system path can make up for the fact that we don't cd before discovering tests --- .../workflows/unittest_by_path_with_env.yml | 49 +++++++++++++++++++ .../unittest_by_path_with_pythonpath.yml | 47 ++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 .github/workflows/unittest_by_path_with_env.yml create mode 100644 .github/workflows/unittest_by_path_with_pythonpath.yml diff --git a/.github/workflows/unittest_by_path_with_env.yml b/.github/workflows/unittest_by_path_with_env.yml new file mode 100644 index 00000000..10bdf024 --- /dev/null +++ b/.github/workflows/unittest_by_path_with_env.yml @@ -0,0 +1,49 @@ +# This workflow is used to run the unittest of pyiron + +name: Unittests-openmpi + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + include: + + - operating-system: ubuntu-latest + python-version: '3.11' + label: linux-64-py-3-11-openmpi + prefix: /usr/share/miniconda3/envs/my-env + + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2.2.0 + with: + python-version: ${{ matrix.python-version }} + mamba-version: "*" + channels: conda-forge + miniforge-variant: Mambaforge + channel-priority: strict + auto-update-conda: true + environment-file: .ci_support/environment-openmpi.yml + - name: Setup env + run: | + PWD=$(pwd) + echo "PYTHONPATH=$PWD/tests:$PYTHONPATH" >> $GITHUB_ENV + - name: Test + shell: bash -l {0} + timeout-minutes: 5 + run: | + pip install versioneer[toml]==0.29 + pip install . --no-deps --no-build-isolation + python -m unittest discover tests + env: + OMPI_MCA_plm: 'isolated' + OMPI_MCA_rmaps_base_oversubscribe: 'yes' + OMPI_MCA_btl_vader_single_copy_mechanism: 'none' diff --git a/.github/workflows/unittest_by_path_with_pythonpath.yml b/.github/workflows/unittest_by_path_with_pythonpath.yml new file mode 100644 index 00000000..fe7395d1 --- /dev/null +++ b/.github/workflows/unittest_by_path_with_pythonpath.yml @@ -0,0 +1,47 @@ +# This workflow is used to run the unittest of pyiron + +name: Unittests-openmpi + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + include: + + - operating-system: ubuntu-latest + python-version: '3.11' + label: linux-64-py-3-11-openmpi + prefix: /usr/share/miniconda3/envs/my-env + + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2.2.0 + with: + python-version: ${{ matrix.python-version }} + mamba-version: "*" + channels: conda-forge + miniforge-variant: Mambaforge + channel-priority: strict + auto-update-conda: true + environment-file: .ci_support/environment-openmpi.yml + - name: Test + shell: bash -l {0} + timeout-minutes: 5 + run: | + pip install versioneer[toml]==0.29 + pip install . --no-deps --no-build-isolation + PWD=$(pwd) + export PYTHONPATH=$PWD/tests:$PYTHONPATH + python -m unittest discover tests + env: + OMPI_MCA_plm: 'isolated' + OMPI_MCA_rmaps_base_oversubscribe: 'yes' + OMPI_MCA_btl_vader_single_copy_mechanism: 'none' From 936e02729ed3ab7389cf78e5b2a48c36f664e674 Mon Sep 17 00:00:00 2001 From: liamhuber Date: Tue, 28 Nov 2023 14:00:48 -0800 Subject: [PATCH 3/3] Change workflow names So we can actually find them! --- .github/workflows/unittest_by_path.yml | 2 +- .github/workflows/unittest_by_path_with_env.yml | 2 +- .github/workflows/unittest_by_path_with_pythonpath.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unittest_by_path.yml b/.github/workflows/unittest_by_path.yml index 2245526c..a9d26011 100644 --- a/.github/workflows/unittest_by_path.yml +++ b/.github/workflows/unittest_by_path.yml @@ -1,6 +1,6 @@ # This workflow is used to run the unittest of pyiron -name: Unittests-openmpi +name: Unittests_by_path on: push: diff --git a/.github/workflows/unittest_by_path_with_env.yml b/.github/workflows/unittest_by_path_with_env.yml index 10bdf024..00f7ea7e 100644 --- a/.github/workflows/unittest_by_path_with_env.yml +++ b/.github/workflows/unittest_by_path_with_env.yml @@ -1,6 +1,6 @@ # This workflow is used to run the unittest of pyiron -name: Unittests-openmpi +name: Unittests_by_path_with_env on: push: diff --git a/.github/workflows/unittest_by_path_with_pythonpath.yml b/.github/workflows/unittest_by_path_with_pythonpath.yml index fe7395d1..1a6fb335 100644 --- a/.github/workflows/unittest_by_path_with_pythonpath.yml +++ b/.github/workflows/unittest_by_path_with_pythonpath.yml @@ -1,6 +1,6 @@ # This workflow is used to run the unittest of pyiron -name: Unittests-openmpi +name: Unittests_by_path_with_pythonpath on: push: