Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/VOLTTRON/volttron into b…
Browse files Browse the repository at this point in the history
…ugfix/2688_vctl_multiple_calls_during_install
  • Loading branch information
craig8 committed Jul 27, 2021
2 parents bdb8f92 + 2c5b502 commit ef7c32c
Show file tree
Hide file tree
Showing 47 changed files with 1,612 additions and 658 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Handles CLRF/RF EOL issue
* text=auto
48 changes: 9 additions & 39 deletions .github/workflows/pytest-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
name: Testing platform auth

# Determine what events are going to trigger a running of the workflow
on: [push, pull_request]
on: [pull_request, push]

jobs:
# The job named build
Expand All @@ -25,7 +25,7 @@ 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 ]

# Run-on determines the operating system available to run on
Expand All @@ -38,50 +38,20 @@ jobs:
# checkout the volttron repository and set current direectory 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 }}
# setup the python environment for the operating system
- name: Set up Python ${{matrix.os}} ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

# 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: 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/platform/auth_tests -rf -o junit_family=xunit2 --junitxml=output/test-auth-${{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/platform/auth_tests
test_output_suffix: auth

# Archive the results from the pytest to storage.
- name: Archive test results
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/pytest-dbutils.yml
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/free-pro-team@l.atest/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
53 changes: 12 additions & 41 deletions .github/workflows/pytest-testutils.yml
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.
#
Expand All @@ -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/publish-unit-test-result-action@v1.5
# if: always()
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
![image](docs/source/files/VOLLTRON_Logo_Black_Horizontal_with_Tagline.png)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/fcf58045b4804edf8f4d3ecde3016f76)](https://app.codacy.com/gh/VOLTTRON/volttron?utm_source=github.com&utm_medium=referral&utm_content=VOLTTRON/volttron&utm_campaign=Badge_Grade_Settings)

![example workflow](https://github.com/volttron/volttron/actions/workflows/pytest-testutils.yml/badge.svg)

VOLTTRON™ is an open source platform for distributed sensing and control. The
platform provides services for collecting and storing data from buildings and
devices and provides an environment for developing applications which interact
with that data.

[![Build Status](https://travis-ci.org/VOLTTRON/volttron.svg?branch=develop)](https://travis-ci.org/VOLTTRON/volttron)

## Features

Expand Down Expand Up @@ -150,7 +151,7 @@ You can deactivate the environment at any time by running `deactivate`.
##### 5. Create RabbitMQ setup for VOLTTRON:

```sh
vcfg --rabbitmq single [optional path to rabbitmq_config.yml]
vcfg rabbitmq single [--config optional path to rabbitmq_config.yml]
```

Refer to [examples/configurations/rabbitmq/rabbitmq_config.yml](examples/configurations/rabbitmq/rabbitmq_config.yml)
Expand Down Expand Up @@ -180,9 +181,9 @@ be configured. The VOLTTRON instance name will be read from volttron_home/config
if available, if not the user will be prompted for VOLTTRON instance name. To
run the scripts without any prompts, save the VOLTTRON instance name in
volttron_home/config file and pass the VOLTTRON home directory as a command line
argument. For example: `vcfg --vhome /home/vdev/.new_vhome --rabbitmq single`
argument. For example: `vcfg --vhome /home/vdev/.new_vhome rabbitmq single`

The Following are the example inputs for `vcfg --rabbitmq single` command. Since no
The Following are the example inputs for `vcfg rabbitmq single` command. Since no
config file is passed the script prompts for necessary details.

```sh
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ef7c32c

Please sign in to comment.