作者你好,python版增加自定义断言、json参数可整体用变量替换、csv中定义用例名,麻烦看下这样实现合理不 #1305
Workflow file for this run
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
name: Run unittests | |
on: | |
push: | |
branches: | |
- master | |
- v2 | |
- v3 | |
pull_request: | |
env: | |
DISABLE_GA: "true" | |
jobs: | |
py-httprunner: | |
runs-on: ${{ matrix.os }} | |
services: | |
service-httpbin: | |
image: kennethreitz/httpbin | |
ports: | |
- 80:80 | |
strategy: | |
fail-fast: false | |
max-parallel: 12 | |
matrix: | |
python-version: ['3.7', '3.8', '3.9', '3.10'] | |
os: [ubuntu-latest] # FIXME: docker services are not supported on macos-latest, windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry --version | |
poetry install -vv | |
- name: Run unittest for httprunner | |
run: | | |
poetry run httprunner | |
poetry run hmake | |
poetry run hrun | |
poetry run coverage run --source=httprunner -m pytest httprunner | |
- name: coverage report | |
run: | | |
poetry run coverage xml | |
poetry run coverage report -m | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
# User defined upload name. Visible in Codecov UI | |
name: httprunner | |
# Repository upload token - get it from codecov.io | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# Path to coverage file to upload | |
file: ./coverage.xml | |
# Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome) | |
flags: unittests | |
# Specify whether or not CI build should fail if Codecov runs into an error during upload | |
fail_ci_if_error: true | |
go-hrp: | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: | |
- 1.18.x | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install Python plugin dependencies | |
run: python3 -m pip install funppy | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Run coverage | |
run: go test -coverprofile="cover.out" -covermode=atomic -race ./... | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
name: hrp (HttpRunner+) # User defined upload name. Visible in Codecov UI | |
token: ${{ secrets.CODECOV_TOKEN }} # Repository upload token | |
file: ./cover.out # Path to coverage file to upload | |
flags: unittests # Flag upload to group coverage metrics | |
fail_ci_if_error: true # Specify whether or not CI build should fail if Codecov runs into an error during upload | |
verbose: true |