Address PR comments

Signed-off-by: John <jonawals@amazon.com>
This commit is contained in:
John
2021-06-28 13:01:57 +01:00
parent 773fb4ea74
commit ee537ae8fa
3 changed files with 29 additions and 30 deletions
@@ -39,6 +39,14 @@ namespace PythonCoverage
PythonCoverageEditorSystemComponent() = default;
private:
//! The coverage state for Python tests.
enum class CoverageState : AZ::u8
{
Disabled, //!< Python coverage is disabled.
Idle, //!< Python coverage is enabled but not actively gathering coverage data.
Gathering //!< Python coverage is enabled and actively gathering coverage data.
};
// AZ::Component overrides...
void Activate() override;
void Deactivate() override;
@@ -49,17 +57,17 @@ namespace PythonCoverage
// AZ::EditorPythonScriptNotificationsBus ...
void OnStartExecuteByFilenameAsTest(AZStd::string_view filename, AZStd::string_view testCase, const AZStd::vector<AZStd::string_view>& args) override;
//! Attempts to parse the test impact analysis framework configuration file.
//! If either the test impact analysis framework is disabled or the configuration file cannot be parsed, python coverage
//! is disabled.
void ParseCoverageOutputDirectory();
//! Enumerates all of the loaded shared library modules and the component descriptors that belong to them.
void EnumerateAllModuleComponents();
//! Enumerates all of the component descriptors for the specified entity.
void EnumerateComponentsForEntity(const AZ::EntityId& entityId);
//! Attempts to parse the test impact analysis framework configuration file.
//! If either the test impact analysis framework is disabled or the configuration file cannot be parsed, python coverage is disabled.
//! @returns The coverage state after the parsing attempt.
CoverageState ParseCoverageOutputDirectory();
//! Returns all of the shared library modules that parent the component descriptors of the specified set of activated entities.
//! @note Entity component descriptors are still retrieved even if the entity in question has since been deactivated.
//! @param entityComponents The set of activated entities and their component descriptors to get the parent modules for.
@@ -69,13 +77,6 @@ namespace PythonCoverage
//! Writes the current coverage data snapshot to disk.
void WriteCoverageFile();
enum class CoverageState : AZ::u8
{
Disabled, //!< Python coverage is disabled.
Idle, //!< Python coverage is enabled but not actively gathering coverage data.
Gathering //!< Python coverage is enabled and actively gathering coverage data.
};
CoverageState m_coverageState = CoverageState::Disabled; //!< Current coverage state.
AZStd::unordered_map<AZStd::string, AZStd::unordered_map<AZ::Uuid, AZ::ComponentDescriptor*>> m_entityComponentMap; //!< Map of
//!< component IDs to component descriptors for all activated entities, organized by test cases.