diff options
-rw-r--r-- | .github/workflows/qatest.yaml | 201 | ||||
-rw-r--r-- | .pre-commit-config.yaml | 2 | ||||
-rw-r--r-- | indra/llcharacter/llbvhloader.cpp | 4 | ||||
-rw-r--r-- | indra/llfilesystem/lldir.cpp | 5 | ||||
-rw-r--r-- | indra/llui/llscrolllistctrl.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llhudtext.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 16 |
8 files changed, 220 insertions, 16 deletions
diff --git a/.github/workflows/qatest.yaml b/.github/workflows/qatest.yaml index aafe455b61..14530ec824 100644 --- a/.github/workflows/qatest.yaml +++ b/.github/workflows/qatest.yaml @@ -50,7 +50,7 @@ jobs: # - os: mac # runner: qa-mac # artifact: Mac-installer - # install-path: 'HOME/Documents/viewer-automation-main' + # install-path: '$HOME/Documents/viewer-automation' fail-fast: false runs-on: [self-hosted, "${{ matrix.runner }}"] @@ -91,6 +91,96 @@ jobs: } Write-Host '✅ viewer-automation folder is provided.' + - name: Verify viewer-automation-main is Up-To-Date (Windows) + if: matrix.os == 'windows' + shell: pwsh + continue-on-error: true + run: | + cd ${{ matrix.install-path }} + Write-Host "Checking for repository updates..." + + # Check if .git directory exists + if (Test-Path -Path ".git") { + try { + # Save local changes instead of discarding them + git stash push -m "Automated stash before update $(Get-Date)" + Write-Host "Local changes saved (if any)" + + # Update the repository + git pull + Write-Host "✅ Repository updated successfully" + + # Try to restore local changes if any were stashed + $stashList = git stash list + if ($stashList -match "Automated stash before update") { + try { + git stash pop + Write-Host "✅ Local changes restored successfully" + } catch { + Write-Host "⚠️ Conflict when restoring local changes" + # Save the conflicted state in a new branch for later review + $branchName = "conflict-recovery-$(Get-Date -Format 'yyyyMMdd-HHmmss')" + git checkout -b $branchName + Write-Host "✅ Created branch '$branchName' with conflicted state" + + # For test execution, revert to a clean state + git reset --hard HEAD + Write-Host "✅ Reset to clean state for test execution" + } + } + } catch { + Write-Host "⚠️ Could not update repository: $_" + Write-Host "Continuing with existing files..." + } + } else { + Write-Host "⚠️ Not a Git repository, using existing files" + } + + - name: Verify Python Installation (Windows) + if: matrix.os == 'windows' + shell: pwsh + run: | + try { + $pythonVersion = (python --version) + Write-Host "✅ Python found: $pythonVersion" + } catch { + Write-Host "❌ Error: Python not found in PATH. Please install Python on this runner." + exit 1 + } + + - name: Setup Python Virtual Environment (Windows) + if: matrix.os == 'windows' + shell: pwsh + run: | + Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force + cd ${{ matrix.install-path }} + + if (-Not (Test-Path -Path ".venv")) { + Write-Host "Creating virtual environment..." + python -m venv .venv + } else { + Write-Host "Using existing virtual environment" + } + + # Direct environment activation to avoid script execution issues + $env:VIRTUAL_ENV = "$PWD\.venv" + $env:PATH = "$env:VIRTUAL_ENV\Scripts;$env:PATH" + + # Install dependencies + if (Test-Path -Path "requirements.txt") { + Write-Host "Installing dependencies from requirements.txt..." + pip install -r requirements.txt + + # Install Playwright browsers - add this line + Write-Host "Installing Playwright browsers..." + python -m playwright install + } else { + pip install outleap requests behave playwright + # Install Playwright browsers - add this line + Write-Host "Installing Playwright browsers..." + python -m playwright install + } + - name: Fetch & Download Installer Artifact (Windows) if: matrix.os == 'windows' shell: pwsh @@ -210,7 +300,18 @@ jobs: shell: pwsh run: | Write-Host "Running QA Test script on Windows runner: ${{ matrix.runner }}..." - python "${{ matrix.install-path }}\runTests.py" + cd ${{ matrix.install-path }} + + # Activate virtual environment + Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force + $env:VIRTUAL_ENV = "$PWD\.venv" + $env:PATH = "$env:VIRTUAL_ENV\Scripts;$env:PATH" + + # Set runner name as environment variable + $env:RUNNER_NAME = "${{ matrix.runner }}" + + # Run the test script + python runTests.py # Mac-specific steps - name: Set Build ID (Mac) @@ -235,6 +336,91 @@ jobs: fi echo "✅ viewer-automation is provided." + - name: Verify viewer-automation-main is Up-To-Date (Mac) + if: matrix.os == 'mac' + shell: bash + continue-on-error: true + run: | + cd ${{ matrix.install-path }} + echo "Checking for repository updates..." + + # Check if .git directory exists + if [ -d ".git" ]; then + # Save local changes instead of discarding them + git stash push -m "Automated stash before update $(date)" + echo "Local changes saved (if any)" + + # Update the repository + git pull || echo "⚠️ Could not update repository" + echo "✅ Repository updated (or attempted update)" + + # Try to restore local changes if any were stashed + if git stash list | grep -q "Automated stash before update"; then + # Try to pop the stash, but be prepared for conflicts + if ! git stash pop; then + echo "⚠️ Conflict when restoring local changes" + # Save the conflicted state in a new branch for later review + branch_name="conflict-recovery-$(date +%Y%m%d-%H%M%S)" + git checkout -b "$branch_name" + echo "✅ Created branch '$branch_name' with conflicted state" + + # For test execution, revert to a clean state + git reset --hard HEAD + echo "✅ Reset to clean state for test execution" + else + echo "✅ Local changes restored successfully" + fi + fi + else + echo "⚠️ Not a Git repository, using existing files" + fi + + - name: Verify Python Installation (Mac) + if: matrix.os == 'mac' + shell: bash + run: | + if command -v python3 &> /dev/null; then + PYTHON_VERSION=$(python3 --version) + echo "✅ Python found: $PYTHON_VERSION" + else + echo "❌ Error: Python3 not found in PATH. Please install Python on this runner." + exit 1 + fi + + - name: Setup Python Virtual Environment (Mac) + if: matrix.os == 'mac' + shell: bash + run: | + cd ${{ matrix.install-path }} + + # Create virtual environment if it doesn't exist + if [ ! -d ".venv" ]; then + echo "Creating virtual environment..." + python3 -m venv .venv + else + echo "Using existing virtual environment" + fi + + # Activate virtual environment + source .venv/bin/activate + + # Install dependencies + if [ -f "requirements.txt" ]; then + pip install -r requirements.txt + echo "✅ Installed dependencies from requirements.txt" + + # Install Playwright browsers - add this line + echo "Installing Playwright browsers..." + python -m playwright install + else + pip install outleap requests behave playwright + echo "⚠️ requirements.txt not found, installed basic dependencies" + + # Install Playwright browsers - add this line + echo "Installing Playwright browsers..." + python -m playwright install + fi + - name: Fetch & Download Installer Artifact (Mac) if: matrix.os == 'mac' shell: bash @@ -370,7 +556,16 @@ jobs: shell: bash run: | echo "Running QA Test script on Mac runner: ${{ matrix.runner }}..." - python "${{ matrix.install-path }}/runTests.py" + cd ${{ matrix.install-path }} + + # Activate virtual environment + source .venv/bin/activate + + # Set runner name as environment variable + export RUNNER_NAME="${{ matrix.runner }}" + + # Run the test script + python runTests.py # - name: Upload Test Results # if: always() diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1dd7c8c800..8baac5a81d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: indent-with-spaces files: \.(cpp|c|h|inl|py|glsl|cmake)$ - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-xml - id: mixed-line-ending diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 2521f9c8ec..581e9f62d5 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -156,9 +156,9 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error } // Recognize all names we've been told are legal. - for (std::map<std::string, std::string>::value_type& alias_pair : joint_alias_map) + for (const auto& [alias, joint] : joint_alias_map) { - makeTranslation( alias_pair.first , alias_pair.second ); + makeTranslation(alias, joint); } char error_text[128]; /* Flawfinder: ignore */ diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index 99d4850610..b80243c22e 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -110,9 +110,10 @@ std::vector<std::string> LLDir::getFilesInDir(const std::string &dirname) std::vector<std::string> v; - if (exists(p)) + boost::system::error_code ec; + if (exists(p, ec) && !ec.failed()) { - if (is_directory(p)) + if (is_directory(p, ec) && !ec.failed()) { boost::filesystem::directory_iterator end_iter; for (boost::filesystem::directory_iterator dir_itr(p); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 245339b107..ff77b4d482 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1007,7 +1007,7 @@ void LLScrollListCtrl::deleteItems(const LLSD& sd) void LLScrollListCtrl::deleteSelectedItems() { item_list::iterator iter; - for (iter = mItemList.begin(); iter < mItemList.end(); ) + for (iter = mItemList.begin(); iter != mItemList.end(); ) { LLScrollListItem* itemp = *iter; if (itemp->getSelected()) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 3b201582d3..47471edb92 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -757,7 +757,7 @@ void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit) mModelPreview->onLODMeshOptimizerParamCommit(lod, enforce_tri_limit, mode); break; default: - LL_ERRS() << "Only supposed to be called to generate models" << LL_ENDL; + LL_ERRS() << "Only supposed to be called to generate models, val: " << mode << LL_ENDL; break; } diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index fd0d8b696f..c092b4c91a 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -225,10 +225,6 @@ void LLHUDText::renderText() } text_color = segment_iter->mColor; - if (mOnHUDAttachment) - { - text_color = linearColor4(text_color); - } text_color.mV[VALPHA] *= alpha_factor; hud_render_text(segment_iter->getText(), render_position, *fontp, style, shadow, x_offset, y_offset, text_color, mOnHUDAttachment); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 93ff175967..0b8852d07c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4780,7 +4780,18 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save #else boost::filesystem::path b_path(lastSnapshotDir); #endif - if (!boost::filesystem::is_directory(b_path)) + boost::system::error_code ec; + if (!boost::filesystem::is_directory(b_path, ec) || ec.failed()) + { + LLSD args; + args["PATH"] = lastSnapshotDir; + LLNotificationsUtil::add("SnapshotToLocalDirNotExist", args); + resetSnapshotLoc(); + failure_cb(); + return; + } + boost::filesystem::space_info b_space = boost::filesystem::space(b_path, ec); + if (ec.failed()) { LLSD args; args["PATH"] = lastSnapshotDir; @@ -4789,7 +4800,6 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save failure_cb(); return; } - boost::filesystem::space_info b_space = boost::filesystem::space(b_path); if (b_space.free < image->getDataSize()) { LLSD args; @@ -4806,6 +4816,8 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save LLNotificationsUtil::add("SnapshotToComputerFailed", args); failure_cb(); + + // Shouldn't there be a return here? } // Look for an unused file name |