Skip to content
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

Changes to github workflow and volttrontesting based successful workflow run #3139

Closed
wants to merge 11 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ on:
schedule:
- cron: '25 18 * * 2'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ on:
- develop
- releases/**

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
env:
Expand Down Expand Up @@ -65,7 +61,7 @@ jobs:

# 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@v6
uses: volttron/volttron-build-action@v5
timeout-minutes: 600
with:
python_version: ${{ matrix.python-version }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ on:
- main
- develop
- releases/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
Expand Down Expand Up @@ -54,7 +51,7 @@ jobs:

# 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@v6
uses: volttron/volttron-build-action@v5
timeout-minutes: 600
with:
python_version: ${{ matrix.python-version }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ on:
- main
- develop
- releases/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
Expand Down Expand Up @@ -54,7 +51,7 @@ jobs:

# 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@v6
uses: volttron/volttron-build-action@v5
timeout-minutes: 600
with:
python_version: ${{ matrix.python-version }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ on:
- main
- develop
- releases/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
Expand Down Expand Up @@ -54,7 +51,7 @@ jobs:

# 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@v6
uses: volttron/volttron-build-action@v5
timeout-minutes: 600
with:
python_version: ${{ matrix.python-version }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ on:
- main
- develop
- releases/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
env:
Expand Down Expand Up @@ -54,7 +52,7 @@ jobs:

# 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@v6
uses: volttron/volttron-build-action@v5
timeout-minutes: 600
with:
python_version: ${{ matrix.python-version }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ on:
- main
- develop
- releases/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
env:
Expand Down Expand Up @@ -53,7 +51,7 @@ jobs:

# 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@v6
uses: volttron/volttron-build-action@v5
timeout-minutes: 600
with:
python_version: ${{ matrix.python-version }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ on:
- main
- develop
- releases/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
# The job named build
build:
Expand Down Expand Up @@ -57,39 +55,39 @@ jobs:

# Run the specified tests and save the results to a unique file that can be archived for later analysis
- name: Run certs test on ${{ matrix.python-version }}, ${{ matrix.os }}
uses: volttron/volttron-build-action@v6
uses: volttron/volttron-build-action@v5
with:
python_version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
test_path: volttrontesting/platform/web/test_certs.py
test_output_suffix: misc

- name: Run core agent test on ${{ matrix.python-version }}, ${{ matrix.os }}
uses: volttron/volttron-build-action@v6
uses: volttron/volttron-build-action@v5
with:
python_version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
test_path: volttrontesting/platform/test_core_agent.py
test_output_suffix: misc

- name: Run packaging test on ${{ matrix.python-version }}, ${{ matrix.os }}
uses: volttron/volttron-build-action@v6
uses: volttron/volttron-build-action@v5
with:
python_version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
test_path: volttrontesting/platform/test_packaging.py
test_output_suffix: misc

- name: Run platform init test on ${{ matrix.python-version }}, ${{ matrix.os }}
uses: volttron/volttron-build-action@v6
uses: volttron/volttron-build-action@v5
with:
python_version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
test_path: volttrontesting/platform/test_platform_init.py
test_output_suffix: misc

- name: Run sqlite3 test on ${{ matrix.python-version }}, ${{ matrix.os }}
uses: volttron/volttron-build-action@v6
uses: volttron/volttron-build-action@v5
with:
python_version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ on:
- main
- develop
- releases/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
# The strategy allows customization of the build and allows matrixing the version of os and software
Expand All @@ -48,7 +46,7 @@ jobs:

# 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@v6
uses: volttron/volttron-build-action@test_no_rerun
with:
python_version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ on:
- main
- develop
- releases/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
# The job named build
build:
Expand Down Expand Up @@ -57,7 +55,7 @@ jobs:

# 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@v7
uses: volttron/volttron-build-action@test_no_rerun
with:
python_version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/pytest-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ on:
- develop
- releases/**

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
# The job named build
build:
Expand Down Expand Up @@ -60,13 +56,16 @@ jobs:

# 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@v6
uses: volttron/volttron-build-action@test_no_rerun
with:
python_version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
test_path: volttrontesting/platform/auth_tests
test_output_suffix: auth

- name: tmate session
uses: mxschmitt/action-tmate@v3

# Archive the results from the pytest to storage.
- name: Archive test results
uses: actions/upload-artifact@v3
Expand All @@ -75,6 +74,12 @@ jobs:
name: pytest-report
path: output/test-auth-${{matrix.os}}-${{ matrix.python-version }}-results.xml

- name: Archive vlog
uses: actions/upload-artifact@v3
if: always()
with:
name: volttron-log
path: pytest_vlog_file
# - name: Publish Unit Test Results
# uses: EnricoMi/[email protected]
# if: always()
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/pytest-vctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ on:
- main
- develop
- releases/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
# The job named build
build:
Expand Down Expand Up @@ -59,13 +57,17 @@ jobs:

# 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@v6
uses: volttron/volttron-build-action@test_no_rerun

with:
python_version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
test_path: volttrontesting/platform/control_tests
test_output_suffix: control_tests

- name: tmate session
uses: mxschmitt/action-tmate@v3

# Archive the results from the pytest to storage.
- name: Archive test results
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
'pytest_asyncio==0.19.0',
'pytest_timeout==2.1.0'],
'weather': ['Pint==0.19.2'],
'yapf': ['yapf'],
#'yapf': ['yapf'],
'web': ['ws4py==0.5.1',
'PyJWT==1.7.1',
'Jinja2==3.1.2',
Expand Down
8 changes: 5 additions & 3 deletions volttrontesting/fixtures/volttron_platform_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ def build_wrapper(vip_address: str, should_start: bool = True, messagebus: str =
auth_enabled=kwargs.pop('auth_enabled', True))
if should_start:
wrapper.startup_platform(vip_address=vip_address, **kwargs)
if not wrapper.dynamic_agent:
raise ValueError(f"Couldn't start platform successfully for {wrapper.messagebus}")
if wrapper.messagebus == 'rmq':
gevent.sleep(5)
else:
gevent.sleep(2)
assert wrapper.is_running()
return wrapper

Expand Down Expand Up @@ -133,7 +135,7 @@ def volttron_instance(request, **kwargs):
"""
address = kwargs.pop("vip_address", get_rand_vip())
if request.param['messagebus'] == 'rmq':
kwargs['timeout'] = 240
kwargs['timeout'] = 120

wrapper = build_wrapper(address,
messagebus=request.param.get('messagebus', 'zmq'),
Expand Down
2 changes: 1 addition & 1 deletion volttrontesting/platform/dbutils/test_mysqlfuncts.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def get_container_func(request):
create_all_tables(container, historian_version)

mysqlfuncts = get_mysqlfuncts(connection_port)
sleep(25)
sleep(5)
# So that sqlfuncts class can check if metadata is in topics table and sets its variables accordingly
mysqlfuncts.setup_historian_tables()
yield container, mysqlfuncts, connection_port, historian_version
Expand Down
2 changes: 1 addition & 1 deletion volttrontesting/utils/build_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def build_agent(platform: PlatformWrapper, identity=None, agent_class=None):

os.environ['VOLTTRON_HOME'] = platform.volttron_home
agent = platform.build_agent(identity, agent_class=agent_class)
gevent.sleep(0.1) # switch context for a bit
gevent.sleep(0.1) # switch context for a bit
os.environ.pop('VOLTTRON_HOME')
return agent

Expand Down
13 changes: 8 additions & 5 deletions volttrontesting/utils/platformwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def startup_platform(self, vip_address, auth_dict=None,
msgdebug=False,
setupmode=False,
agent_monitor_frequency=600,
timeout=60,
timeout=180,
# Allow the AuthFile to be preauthenticated with keys for service agents.
perform_preauth_service_agents=True):

Expand Down Expand Up @@ -944,8 +944,8 @@ def startup_platform(self, vip_address, auth_dict=None,
# if msgdebug:
# cmd.append('--msgdebug')
if enable_logging:
cmd.append('-v')
cmd.append('-l{}'.format(self.log_path))
cmd.append('-vv')
cmd.append('-l {}'.format(self.log_path))
if setupmode:
cmd.append('--setup-mode')

Expand All @@ -959,8 +959,11 @@ def startup_platform(self, vip_address, auth_dict=None,
# A None value means that the process is still running.
# A negative means that the process exited with an error.
assert self.p_process.poll() is None

utils.wait_for_volttron_startup(self.volttron_home, timeout)
try:
utils.wait_for_volttron_startup(self.volttron_home, timeout)
except Exception:
shutil.copyfile(self.log_path, "pytest_vlog_file")
print(os.path.abspath("pytest_vlog_file"))

if self.auth_enabled:
self.serverkey = self.keystore.public
Expand Down
Loading