Skip to content

Refactor sanity check to use dynamic check fixtures#2883

Merged
wangxin merged 2 commits intosonic-net:masterfrom
wangxin:refactor-sanity
Jan 29, 2021
Merged

Refactor sanity check to use dynamic check fixtures#2883
wangxin merged 2 commits intosonic-net:masterfrom
wangxin:refactor-sanity

Conversation

@wangxin
Copy link
Copy Markdown
Collaborator

@wangxin wangxin commented Jan 28, 2021

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

The check items are defined in the checks.py module. In the original design, check item is defined as an ordinary function. All the dependent fixtures must be specified in the argument list of sanity_check. Then objects of the fixtures are passed to the check functions as arguments. However, this design has a limitation. Not all the sanity check dependent fixtures are supported on all topologies. On some topologies, sanity check may fail with getting those fixtures.

How did you do it?

To resolve that issue, this PR changed the design. Now the check items must be defined as fixtures. Then the check fixtures can be dynamically attached to test cases during run time. In the sanity check plugin, we can check the current testbed type or other conditions to decide whether or not to load certain check fixtures.

How did you verify/test it?

Use a customized test script to verify the combinations of sanity check supported marks and command line options.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

The check items are defined in the `checks.py` module. In the original design, check item is defined as an ordinary function. All the dependent fixtures must be specified in the argument list of `sanity_check`. Then objects of the fixtures are passed to the check functions as arguments. However, this design has a limitation. Not all the sanity check dependent fixtures are supported on all topologies. On some topologies, sanity check may fail with getting those fixtures.

To resolve that issue, this PR changed the design. Now the check items must be defined as fixtures. Then the check fixtures can be dynamically attached to test cases during run time. In the sanity check plugin, we can check the current testbed type or other conditions to decide whether or not to load certain check fixtures.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
@wangxin wangxin requested review from a team and theasianpianist January 28, 2021 08:00
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Jan 28, 2021

This pull request introduces 1 alert when merging 922dd63 into 93f655a - view on LGTM.com

new alerts:

  • 1 for Unused import

@lguohan
Copy link
Copy Markdown
Contributor

lguohan commented Jan 28, 2021

/Azurepipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@wangxin wangxin merged commit 3696ba1 into sonic-net:master Jan 29, 2021
@wangxin wangxin deleted the refactor-sanity branch February 1, 2021 08:23
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…atically (sonic-net#15590)

src/sonic-utilities

* 436ecb06 - (HEAD -> 202205, origin/202205) [GCU Feature Update] Cherry-pick Platform Validator PR to 202205  (sonic-net#2883) (4 days ago) [isabelmsft]
* 17874100 - [202205][db_migrator] Add migration of FLEX_COUNTER_DELAY_STATUS during 1911->2211 upgrade + fast-reboot. Add UT. (sonic-net#2870) (5 days ago) [Vadym Hlushko]
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…atically (sonic-net#15809)

src/sonic-utilities

* 20853a6f - (HEAD -> 202205, origin/202205) Revert "[GCU Feature Update] Cherry-pick Platform Validator PR to 202205  (sonic-net#2883)" (sonic-net#2908) (6 hours ago) [isabelmsft]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants