kurusugawa-computer / kurusugawa-computer/annofab-api-python-client

CIで実行しないテストを、Pytestのmarkers機能で指定する

Open
#680 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
11
Forks
1
PR merge metrics
No merged PRs in 30d

Description

現状

CIで実行するテストは(WebAPIにアクセスしないテスト)は、ファイル名がtest_local*.pyのものに限定しています。

https://github.com/kurusugawa-computer/annofab-api-python-client/blob/20304c4db3e01eca4d3dec0962b06718817b2529/.github/workflows/lint-test.yml#L32

この方法だと、テスト用のファイルにWebAPIに関係しないテストメソッドがあっても、このテストメソッドをCIで実行することができません。

やりたいこと

Pytestのmarkers機能を使って、CIで実行しないテストを指定できるようにしたいです。

poetry run pytest -n auto -m "not access_webapi"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the test command around line 32 of .github/workflows/lint-test.yml and reviewing how the existing test files are selected. Use the proposed pytest marker expression as the reference, and consider the work complete when CI excludes WebAPI-accessing tests by marker instead of relying only on the test_local*.py filename pattern.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ci-cd, testing-qa
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.