Merged
feat(build): Support mixed execution of STest and Examples in a single pytest command to reduce overall runtime #636
杨旭Add on Jan 23
feat(build): Support mixed execution of STest and Examples in a single pytest command to reduce overall runtime #636
Merged
杨旭Add on Jan 23
杨旭
杨旭Collaborators
Jan 23

feat(build): Support mixed execution of STest and Examples in a single pytest command to reduce overall runtime

Objective:
Enable mixed execution of STest and Examples cases via a single pytest command to reduce overall CI execution time, while unifying configuration files to eliminate conflicts and ensure compatibility across test scenarios.

Key Changes:

  1. Adjust pytest command logic in build_ci.py:
    Analyzed the implementation of build_ci.py and updated the pytest command configuration to execute pytest examples python/tests/st when both -e (Examples) and -s (STest) parameters are specified, enabling mixed running of Examples and STest cases in one command.
  2. Unify conftest.py configuration:
    Resolved the issue of duplicate conftest.py files existing in the examples directory and python/tests directory:
    • Analyzed functional differences between the two conftest.py files;
    • Consolidated all their functionalities into a single conftest.py file placed in the project root directory;
    • Ensured full compatibility with UTest execution scenarios to avoid breaking existing UT workflows.
  3. Centralize pytest.ini configuration:
    Migrated and extended the functionality of examples/pytest.ini to the project root's pytest.ini for unified configuration management:
    • Retained pytest's default file/case matching rules for STest and UTest to maintain consistency with standard test practices;
    • Added support for special file/case matching rules specific to the examples/modules path to preserve its unique test file naming conventions.

Impact:

  • Eliminates configuration conflicts caused by multiple conftest.py and pytest.ini files across directories;
  • Enables mixed execution of STest and Examples via one pytest command, reducing total test runtime;
  • Maintains full compatibility with existing UTest/STest workflows while standardizing configuration management.

Issue: #196

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 杨旭's contribution.)
CANN-robot
CANN-robotCollaborators
Jan 23 Comments:

Thanks for your pull-request.

The full list of commands accepted by me can be found at here.

You can get sig-info at here

likedislike
CANN-robot
CANN-robotCollaborators
Jan 23 Comments:

以下是根据您提交的修改文件推荐的Reviewer和Committer序列,需各模块评审通过后方可合入

Module List Reviewers Committers
repo-cann/pypto N/A zhangqi-chen, linjiashu, yinjie27_, DCGDDD, dai-zhentao
likedislike
CANN-robotCANN-robotCollaborators
Jan 23 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Jan 23 Comments:

🔵 source code change are detected, tasks labels is removed in this pull request!

likedislike
杨旭
杨旭Collaborators
Jan 23 Comments:

compile

likedislike
51 messages are collapsed here。 See more
lidongsheng
lidongshengCollaborators
Jan 24 Comments:

/lgtm

likedislike
Jie Yin
Jie YinCollaborators
Jan 24 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Jan 24 Added label: lgtmapproved
CANN-robot
CANN-robotCollaborators
Jan 24 Comments:

Review Guide

This Pull-Request Passes Review.
Committers who wrote a comment of /approve are: yinjie27_.
Reviewers who wrote a comment of /lgtm are: yinjie27_, tsungl4.

likedislike
CANN-robotCANN-robotCollaborators
Jan 24 Merged pull request