Skip to content

Add function test concept with YAML testcases #1928

@andy-maier

Description

@andy-maier

Add a function test concept that defines the testcases in YAML files, where each file is one testcase and defines:

  • The zhmcclient API function to be tested and its input parameters to be used
  • The expected payload of the request to the HMC
  • The payload of the response from the HMC that should be injected on the return path
  • The expected zhmcclient API response (including errors)

Ideally, the pytest capability to discover testcases should be used so that each test file is one test for pytest. See https://docs.pytest.org/en/7.1.x/example/pythoncollection.html#customizing-test-collection for the pytest concept and https://github.com/pywbem/pywbem/blob/master/tests/functiontest/conftest.py for a sample implementation.

The benefit of this approach is that it allows end2end-like tests without actually using an HMC, so this test can be run during PR-level testing. Also, this approach avoids having to implement zhmcclient_mock support (which has always been a lot of work for a pretty incomplete mock implementation).

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions