-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Workflows; add dbutils Workflows
- Loading branch information
Showing
4 changed files
with
76 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
# This workflow is meant as a foundational workflow for running integration/unit tests on the | ||
# platform. For this workflow we are testing the | ||
# | ||
# volttrontesting/testutils directory using pytest. | ||
# | ||
# This workflow also shows the caching mechanisms available for storage | ||
# and retrieval of cache for quicker setup of test environments. | ||
|
||
name: Testing dbutils directory | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
# The strategy allows customization of the build and allows matrixing the version of os and software | ||
# https://docs.github.com/en/[email protected]/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Each entry in the os and python-version matrix will be run so for the 3 x 4 there will be 12 jobs run | ||
os: [ ubuntu-18.04, ubuntu-20.04 ] | ||
python-version: [ 3.6, 3.7] # , 3.8, 3.9 ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
env: | ||
TEST_TYPE: dbutils | ||
steps: | ||
# checkout the volttron repository and set current directory to it | ||
- uses: actions/checkout@v2 | ||
|
||
# Attempt to restore the cache from the build-dependency-cache workflow if present then | ||
# the output value steps.check_files.outputs.files_exists will be set (see the next step for usage) | ||
- name: Set up Python ${{matrix.os}} ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# Run the specified tests and save the results to a unique file that can be archived for later analysis. | ||
- name: Run pytest on ${{ matrix.python-version }}, ${{ matrix.os }} | ||
uses: volttron/volttron-build-action@v1 | ||
with: | ||
python_version: ${{ matrix.python-version }} | ||
os: ${{ matrix.os }} | ||
test_path: volttrontesting/platform/${{ env.TEST_TYPE }} | ||
test_output_suffix: ${{ env.TEST_TYPE }} | ||
|
||
# Archive the results from the pytest to storage. | ||
- name: Archive test results | ||
uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: pytest-report | ||
path: output/${{ env.TEST_TYPE }}-${{matrix.os}}-${{ matrix.python-version }}-results.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
# This workflow is meant as a foundational workflow for running integration/unit tests on the | ||
# plaform. For this workflow we are testing the | ||
# platform. For this workflow we are testing the | ||
# | ||
# volttrontesting/testutils directory using pytest. | ||
# | ||
|
@@ -18,68 +18,39 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
# Each entry in the os and python-version matrix will be run so for the 3 x 4 there will be 12 jobs run | ||
os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04 ] | ||
os: [ ubuntu-18.04, ubuntu-20.04 ] | ||
python-version: [ 3.6, 3.7] # , 3.8, 3.9 ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
# checkout the volttron repository and set current direectory to it | ||
# checkout the volttron repository and set current directory to it | ||
- uses: actions/checkout@v2 | ||
|
||
# Install erlang for rabbitmq | ||
- name: Install erlang | ||
if: matrix.os != 'ubuntu-20.04' | ||
run: | | ||
sudo scripts/rabbit_dependencies.sh debian ${{ matrix.os }} | ||
# Attempt to restore the cache from the build-dependency-cache workflow if present then | ||
# the output value steps.check_files.outputs.files_exists will be set (see the next step for usage) | ||
- name: Set up Python ${{matrix.os}} ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# Determine if the cache was restored or not. | ||
- name: Has restored cache | ||
id: check_files | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: "env/bin/activate" | ||
|
||
# This step is only run if the cache wasn't able to be restored. | ||
- name: Install dependencies including rmq | ||
if: steps.check_files.outputs.files_exists != 'true' && matrix.os != 'ubuntu-20.04' | ||
run: | | ||
pip install wheel | ||
python bootstrap.py --all --rabbitmq --force | ||
- name: Install dependencies other than rmq | ||
if: steps.check_files.outputs.files_exists != 'true' && matrix.os == 'ubuntu-20.04' | ||
run: | | ||
pip install wheel | ||
python bootstrap.py --all --force | ||
- name: Install volttron | ||
run: | | ||
source env/bin/activate | ||
pip install -e . | ||
# Run the specified tests and save the results to a unique file that can be archived for later analysis. | ||
- name: Run pytest | ||
run: | | ||
source env/bin/activate | ||
pip install -e . | ||
pytest volttrontesting/testutils -rf -o junit_family=xunit2 --junitxml=output/test-testutils-${{matrix.os}}-${{ matrix.python-version }}-results.xml | ||
- name: Run pytest on ${{ matrix.python-version }}, ${{ matrix.os }} | ||
uses: volttron/volttron-build-action@v1 | ||
with: | ||
python_version: ${{ matrix.python-version }} | ||
os: ${{ matrix.os }} | ||
test_path: volttrontesting/testutils | ||
test_output_suffix: testutils | ||
|
||
# Archive the results from the pytest to storage. | ||
# Archive the results from the pytest to storage. | ||
- name: Archive test results | ||
uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: pytest-report | ||
path: output/test-testutils-${{matrix.os}}-${{ matrix.python-version }}-results.xml | ||
|
||
# - name: Publish Unit Test Results | ||
# uses: EnricoMi/[email protected] | ||
# if: always() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters