{SPEC-7465} Fix DeleteCachedAssets_AssetsReprocessed fails on Debug Nightly Builds (#1535)

* Fix for DeleteCachedAssets_AssetsReprocessed fails on Debug Nightly Builds
* added -ap_disableAssetTreeView=true to disable the Qt tree view for the asset tab to get the parts that want to be tested finish
* only shows up on Debug

Tests:
=== test session starts ===
AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests_2.py::TestsAssetProcessorBatch_AllPlatforms::test_AllSupportedPlatforms_FastScanWorks_FasterThanFullScan[windows-AutomatedTesting] PASSED [ 50%]
AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests_2.py::TestsAssetProcessorBatch_Windows::test_WindowsPlatforms_RunAPBatchAndConnectGui_RunsWithoutEditor[windows-AutomatedTesting] PASSED [100%]
--- generated xml file: F:\amazon\o3de\build\vs2019\Testing\Pytest\AssetPipelineTests.Batch_2_Sandbox.xml ---
=== 2 passed, 4 deselected in 18.32s ===
This commit is contained in:
jackalbe
2021-06-24 06:47:59 -05:00
committed by GitHub
parent 95313401ed
commit 143b8f1131
3 changed files with 71 additions and 22 deletions
@@ -11,9 +11,11 @@
#include <AzCore/Component/TickBus.h>
#include <AzCore/IO/Path/Path.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzCore/Console/IConsole.h>
namespace AssetProcessor
{
AZ_CVAR_EXTERNED(bool, ap_disableAssetTreeView);
ProductAssetTreeModel::ProductAssetTreeModel(AZStd::shared_ptr<AzToolsFramework::AssetDatabase::AssetDatabaseConnection> sharedDbConnection, QObject *parent) :
AssetTreeModel(sharedDbConnection, parent)
@@ -26,6 +28,11 @@ namespace AssetProcessor
void ProductAssetTreeModel::ResetModel()
{
if (ap_disableAssetTreeView)
{
return;
}
m_productToTreeItem.clear();
m_productIdToTreeItem.clear();
AZStd::string databaseLocation;
@@ -46,6 +53,11 @@ namespace AssetProcessor
void ProductAssetTreeModel::OnProductFileChanged(const AzToolsFramework::AssetDatabase::ProductDatabaseEntry& entry)
{
if (ap_disableAssetTreeView)
{
return;
}
// Model changes need to be run on the main thread.
AZ::SystemTickBus::QueueFunction([&, entry]()
{
@@ -107,6 +119,11 @@ namespace AssetProcessor
void ProductAssetTreeModel::OnProductFileRemoved(AZ::s64 productId)
{
if (ap_disableAssetTreeView)
{
return;
}
// UI changes need to be done on the main thread.
AZ::SystemTickBus::QueueFunction([&, productId]()
{
@@ -116,6 +133,11 @@ namespace AssetProcessor
void ProductAssetTreeModel::OnProductFilesRemoved(const AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& products)
{
if (ap_disableAssetTreeView)
{
return;
}
// UI changes need to be done on the main thread.
AZ::SystemTickBus::QueueFunction([&, products]()
{
@@ -128,6 +150,11 @@ namespace AssetProcessor
QModelIndex ProductAssetTreeModel::GetIndexForProduct(const AZStd::string& product)
{
if (ap_disableAssetTreeView)
{
return QModelIndex();
}
auto productItem = m_productToTreeItem.find(product);
if (productItem == m_productToTreeItem.end())
{