o3de / sig-testing

Documentation and materials for the Open 3D Engine Test Special Interest Group
9 stars 7 forks source link

RFC: Re-factor the pytest.Class objects in the editor_test framework code. #42

Closed jromnoa closed 2 years ago

jromnoa commented 2 years ago

Summary:

What is the relevance of this feature?

Feature design description:

Technical design description:

  1. Write out a new architectural chart for how the existing objects function and where we want our new pytest.Class object to go to modify this existing architecture. This will help keep the work focused and guided before diving deep into the coding aspects (perhaps a future RFC review can contain this effort, for all of @o3de/sig-testing to review together).
  2. Create a new class in the new multi_test_framework.py module. Name it something similar to the other class objects in there (i.e. AbstractTestClass which we'll go with for the rest of this design description to make it easier to follow).
  3. Have the AbstractTestClass inherit from pytest.Class similar to how EditorTestClass inside editor_test.py does: AbstractTestClass(pytest.Class).
  4. Add all shareable functions and code into the new AbstractTestClass object.
  5. MaterialEditorTestClass and EditorTestClass should inherit from AbstractTestClass: MaterialEditorTestClass(AbstractTestClass) & EditorTestClass(AbstractTestClass).
  6. You will probably need to do a super().__init__() call for these classes after inheriting from AbstractTestClass.
  7. Do not break any existing interfaces and do not rename anything that is used by the tests inside https://github.com/o3de/o3de/tree/development/AutomatedTesting/Gem/PythonTests since we want to make adoption of this for test writers as least disruptive as possible (emergent work kills sprint productivity).

What are the advantages of the feature?

What are the disadvantages of the feature?

How will this be implemented or integrated into the O3DE environment?

Are there any alternatives to this feature?

How will users learn this feature?

Are there any open questions?

jromnoa commented 2 years ago

I found a way to work around this actually so it won't be needed. I was able to split this class into its own object and successfully launch with it.