Skip to content

Commit

Permalink
Merge branch 'avocado-framework:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
zuohanxu authored Aug 1, 2023
2 parents b7900cd + 7da1c75 commit d35b1e5
Show file tree
Hide file tree
Showing 169 changed files with 3,639 additions and 1,304 deletions.
58 changes: 41 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,24 @@ jobs:
name: Static checks
runs-on: ubuntu-20.04
container:
image: quay.io/avocado-framework/avocado-ci-fedora-36
image: quay.io/avocado-framework/avocado-ci-fedora-38

steps:
- run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}, runner on ${{ runner.os }}"
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Allow git to operate on directory checked out by GH Actions
run: git config --global --add safe.directory `pwd`
- name: Installing Avocado development dependencies
run: make requirements-dev
- name: Installing Avocado in develop mode
run: python3 setup.py develop --user
- name: Run static checks
env:
COMMIT_COUNT: ${{ github.event.pull_request.commits }}
run: python3 setup.py test --select=static-checks
- name: Archive failed tests logs
if: failure()
Expand All @@ -35,10 +38,34 @@ jobs:
retention-days: 1
- run: echo "🥑 This job's status is ${{ job.status }}."

full-smokecheck-linux:
smokecheck-linux:

name: Smokecheck on Linux with Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04

strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10.0, 3.11]
fail-fast: false

steps:
- run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}, runner on ${{ runner.os }}"
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Avocado smokecheck
run: make smokecheck

check-linux:

name: Linux with Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
needs: smokecheck-linux

strategy:
matrix:
Expand All @@ -63,8 +90,6 @@ jobs:
run: python3 setup.py develop --user
- name: Avocado version
run: avocado --version
- name: Avocado smoketest
run: python -m avocado run examples/tests/passtest.py
- name: Unittests and fast functional tests
run: python3 setup.py test --skip=static-checks
- name: Archive failed tests logs
Expand Down Expand Up @@ -109,11 +134,11 @@ jobs:
- run: echo "🥑 This job's status is ${{ job.status }}."


# OS X smokecheck on latest Python
# macOS check on latest Python

smokecheck-osx:
check-macos:

name: OS X with Python ${{ matrix.python-version }}
name: macOS with Python ${{ matrix.python-version }}
runs-on: macos-12

strategy:
Expand Down Expand Up @@ -141,7 +166,7 @@ jobs:
- name: List test
run: python -m avocado --verbose list selftests/unit/* selftests/functional/* selftests/*sh
- name: Run a subset of avocado's selftests
run: PATH=~/Library/Python/3.11/bin:$PATH ./selftests/check.py --select=nrunner-interface,job-api,jobs,optional-plugins
run: PATH=~/Library/Python/3.11/bin:$PATH ./selftests/check.py --skip=static-checks
- run: echo "🥑 This job's status is ${{ job.status }}."


Expand Down Expand Up @@ -238,7 +263,6 @@ jobs:
fetch-depth: 0
- name: Run Codespell Check
run: make -f Makefile.gh codespell
continue-on-error: True
- name: Run bandit check
run: make -f Makefile.gh bandit
continue-on-error: True
Expand All @@ -257,10 +281,10 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
container: ["fedora:35",
"fedora:36",
"registry.access.redhat.com/ubi8/ubi",
"registry.access.redhat.com/ubi9-beta/ubi",
container: ["fedora:37",
"fedora:38",
"registry.access.redhat.com/ubi8/ubi:8.8",
"registry.access.redhat.com/ubi9/ubi:9.2",
"debian:10.10",
"debian:11.0",
"ubuntu:21.10",
Expand All @@ -286,10 +310,10 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
container: ["fedora:35",
"fedora:36",
"registry.access.redhat.com/ubi8/ubi",
"registry.access.redhat.com/ubi9-beta/ubi",
container: ["fedora:37",
"fedora:38",
"registry.access.redhat.com/ubi8/ubi:8.8",
"registry.access.redhat.com/ubi9/ubi:9.2",
"debian:10.10",
"debian:11.0",
"ubuntu:21.10",
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/pr_announcement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: PR announcement

on:
pull_request_target:
types:
- opened

jobs:
commnet-to-pr:
name: Do an announcement to PR
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c
with:
app_id: ${{ secrets.MR_AVOCADO_ID }}
installation_id: ${{ secrets.MR_AVOCADO_INSTALLATION_ID }}
private_key: ${{ secrets.MR_AVOCADO_PRIVATE_KEY }}
- name: Get PR ID
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
pr_data=$(gh api graphql -f query='query {
repository(owner:"avocado-framework", name:"avocado") {
pullRequest(number:${{ github.event.number }}) {
id
}
}
}')
echo 'PR_ID='$(echo $pr_data | jq .data.repository.pullRequest.id) >> $GITHUB_ENV
- name: comment on PR
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
gh api graphql -f query='mutation {
addComment(input: {
subjectId: ${{ env.PR_ID }},
body: """Dear contributor,
Avocado is currently under sprint #103, which is due to release an LTS (Long Term Stability) release.
Please avoid merging changes that do not fall into these categories:
* Bug fixes
* Usability Improvements
* Documentation updates
As for the Avocado utility modules (“avocado.utils”) it is OK to introduce new functionality,
but changes to the existing APIs (including interface and behavior) should be avoided.
These kind of changes should wait until sprint #104."""}) {
clientMutationId
}
}'
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
name: Avocado deployment
runs-on: ubuntu-latest
container:
image: fedora:36
image: fedora:38
env:
GIT_URL: 'https://github.com/avocado-framework/avocado'
INVENTORY: 'selftests/deployment/inventory'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Build eggs
run: python setup.py bdist_egg
run: make -f Makefile.gh build-egg
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: ${{ github.workspace }}/dist/avocado_framework*
file: ${{ github.workspace }}/EGG_UPLOAD/avocado_framework*egg
tag: ${{ github.event.inputs.version }}
overwrite: true
file_glob: true
2 changes: 0 additions & 2 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
run: python -m avocado run examples/tests/passtest.py
- name: Tree static check, unittests and fast functional tests
run: |
export AVOCADO_LOG_DEBUG="yes"
export AVOCADO_CHECK_LEVEL="1"
python3 selftests/check.py
- name: Archive test logs
Expand Down Expand Up @@ -86,7 +85,6 @@ jobs:
run: avocado --version
- name: Tree static check, unittests and fast functional tests without plugins
run: |
export AVOCADO_LOG_DEBUG="yes"
export AVOCADO_CHECK_LEVEL="1"
python3 selftests/check.py --disable-plugin-checks golang,html,resultsdb,result_upload,robot,varianter_cit,varianter_pict,varianter_yaml_to_mux
- name: Archive test logs
Expand Down
6 changes: 3 additions & 3 deletions .packit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- centos-stream-9
- epel-8
- epel-9
- fedora-36-aarch64
- fedora-36-ppc64le
- fedora-36-s390x
- fedora-38-aarch64
- fedora-38-ppc64le
- fedora-38-s390x
enable_net: False
9 changes: 5 additions & 4 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ enable=all
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once). You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# disable everything first and then re-enable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
Expand Down Expand Up @@ -120,7 +120,8 @@ disable=C0103,
W0212,
W0511,
W0703,
W0707
W0707,
W1203


[REPORTS]
Expand Down Expand Up @@ -540,5 +541,5 @@ valid-metaclass-classmethod-first-arg=cls

# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=builtin.BaseException,
builtin.Exception
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
include Makefile.include

DESTDIR=/
AVOCADO_DIRNAME=$(shell basename ${PWD})
AVOCADO_OPTIONAL_PLUGINS=$(shell find ./optional_plugins -maxdepth 1 -mindepth 1 -type d)


all:
@echo
@echo "Development related targets:"
Expand All @@ -27,6 +20,13 @@ all:
@echo "pip: Auxiliary target to install pip. (It's not recommended to run this directly)"
@echo

include Makefile.include

DESTDIR=/
AVOCADO_DIRNAME=$(shell basename ${PWD})
AVOCADO_OPTIONAL_PLUGINS=$(shell find ./optional_plugins -maxdepth 1 -mindepth 1 -type d)


clean:
$(PYTHON) setup.py clean --all

Expand All @@ -40,12 +40,11 @@ requirements-dev: pip
- $(PYTHON) -m pip install -r requirements-dev.txt $(PYTHON_DEVELOP_ARGS)

smokecheck: clean uninstall develop
PYTHON=$(PYTHON) $(PYTHON) -m avocado run passtest.py
$(PYTHON) -m avocado run examples/tests/passtest.py

check: clean uninstall develop
# Unless manually set, this is equivalent to AVOCADO_CHECK_LEVEL=0
PYTHON=$(PYTHON) $(PYTHON) selftests/check.py
selftests/check_tmp_dirs
$(PYTHON) selftests/check.py

develop:
$(PYTHON) setup.py develop $(PYTHON_DEVELOP_ARGS)
Expand Down
4 changes: 2 additions & 2 deletions Makefile.gh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ all:
@echo

codespell:
pip install codespell
codespell --check-filenames --check-hidden --skip ".git,*.js,./selftests/unit/utils/cpu.py.data/*"
pip install codespell==2.2.4
codespell --check-filenames --check-hidden --skip ".git,*.js,./selftests/unit/utils/cpu.py.data/*,./avocado/utils/pmem.py,./avocado/utils/cpu.py,./avocado/utils/linux_modules.py,./selftests/functional/output.py,./selftests/unit/utils/vmimage.py"

bandit:
pip install bandit
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
101.0
102.0
8 changes: 5 additions & 3 deletions avocado/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@

from avocado.core.dispatcher import InitDispatcher
from avocado.core.settings import settings as stgs
from avocado.core.streams import BUILTIN_STREAM_SETS, BUILTIN_STREAMS
from avocado.core.streams import BUILTIN_STREAM_SETS, BUILTIN_STREAMS_DESCRIPTION
from avocado.core.utils.path import prepend_base_path


def register_core_options():
streams = [
'"%s": %s' % _ for _ in BUILTIN_STREAMS.items() # pylint: disable=C0209
f'"{stream}": {description}'
for stream, description in BUILTIN_STREAMS_DESCRIPTION.items()
] + [
'"%s": %s' % _ for _ in BUILTIN_STREAM_SETS.items() # pylint: disable=C0209
f'"{stream}": {description}'
for stream, description in BUILTIN_STREAM_SETS.items()
]
streams = "; ".join(streams)
help_msg = (
Expand Down
Loading

0 comments on commit d35b1e5

Please sign in to comment.