From 42d28d63ac20d2db864316a5566b873e5ffe902d Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 4 Nov 2024 13:09:17 -0700 Subject: [PATCH] Fix extract location --- .github/workflows/test-action-windows.yml | 56 ++++++++++--------- .../workflows/test-packages-action-linux.yml | 4 +- .../test-packages-action-windows.yml | 16 ++---- noxfile.py | 5 +- 4 files changed, 41 insertions(+), 40 deletions(-) diff --git a/.github/workflows/test-action-windows.yml b/.github/workflows/test-action-windows.yml index 67aed7409834..c2a1b0f3a841 100644 --- a/.github/workflows/test-action-windows.yml +++ b/.github/workflows/test-action-windows.yml @@ -162,11 +162,6 @@ jobs: run: | echo true - - name: Download nox.windows.${{ inputs.arch }}.tar.* artifact for session ${{ inputs.nox-session }} - uses: actions/download-artifact@v4 - with: - name: nox-windows-${{ inputs.arch }}-${{ inputs.nox-session }} - - name: Set up Python ${{ inputs.gh-actions-python-version }} uses: actions/setup-python@v5 with: @@ -178,6 +173,11 @@ jobs: env: PIP_INDEX_URL: https://pypi.org/simple + - name: Download nox.windows.${{ inputs.arch }}.tar.* artifact for session ${{ inputs.nox-session }} + uses: actions/download-artifact@v4 + with: + name: nox-windows-${{ inputs.arch }}-${{ inputs.nox-session }} + - name: Decompress .nox Directory run: | nox --force-color -e decompress-dependencies -- windows ${{ inputs.arch }} @@ -188,6 +188,11 @@ jobs: with: name: testrun-changed-files.txt + - name: Check nox python + continue-on-error: true + run: | + .nox/ci-test-onedir/Scripts/python.exe --version + - name: Show System Info env: SKIP_REQUIREMENTS_INSTALL: "1" @@ -208,10 +213,10 @@ jobs: SKIP_INITIAL_GH_ACTIONS_FAILURES: "1" SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}" COVERAGE_CONTEXT: ${{ inputs.distro-slug }} - run: | - nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \ - -k "mac or darwin" --core-tests --slow-tests --suppress-no-test-exit-code \ - --from-filenames=testrun-changed-files.txt + run: > + nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- + -k "mac or darwin" --core-tests --slow-tests --suppress-no-test-exit-code + "--from-filenames=testrun-changed-files.txt" - name: Run Fast Tests id: run-fast-tests @@ -226,9 +231,9 @@ jobs: SKIP_INITIAL_GH_ACTIONS_FAILURES: "1" SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}" COVERAGE_CONTEXT: ${{ inputs.distro-slug }} - run: | - nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \ - -k "mac or darwin" --suppress-no-test-exit-code + run: > + nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- + -k "mac or darwin" --suppress-no-test-exit-code - name: Run Slow Tests id: run-slow-tests @@ -243,9 +248,9 @@ jobs: SKIP_INITIAL_GH_ACTIONS_FAILURES: "1" SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}" COVERAGE_CONTEXT: ${{ inputs.distro-slug }} - run: | - nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \ - -k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --slow-tests + run: > + nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- + -k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --slow-tests - name: Run Core Tests id: run-core-tests @@ -260,9 +265,9 @@ jobs: SKIP_INITIAL_GH_ACTIONS_FAILURES: "1" SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}" COVERAGE_CONTEXT: ${{ inputs.distro-slug }} - run: | - nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \ - -k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --core-tests + run: > + nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- + -k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --core-tests - name: Run Flaky Tests id: run-flaky-tests @@ -277,9 +282,9 @@ jobs: SKIP_INITIAL_GH_ACTIONS_FAILURES: "1" SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}" COVERAGE_CONTEXT: ${{ inputs.distro-slug }} - run: | - nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \ - -k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --flaky-jail + run: > + nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- + -k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --flaky-jail - name: Run Full Tests id: run-full-tests @@ -294,9 +299,9 @@ jobs: SKIP_INITIAL_GH_ACTIONS_FAILURES: "1" SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}" COVERAGE_CONTEXT: ${{ inputs.distro-slug }} - run: | - nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \ - --slow-tests --core-tests -k "mac or darwin" + run: > + nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- + --slow-tests --core-tests -k "mac or darwin" - name: Combine Coverage Reports if: always() && inputs.skip-code-coverage == false @@ -306,11 +311,12 @@ jobs: - name: Prepare Test Run Artifacts id: download-artifacts-from-vm if: always() + shell: bash run: | # Delete the salt onedir, we won't need it anymore and it will prevent # from it showing in the tree command below + rmdir /S /Q artifacts/salt rm -rf artifacts/salt* - tree -a artifacts if [ "${{ inputs.skip-code-coverage }}" != "true" ]; then mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.${{ matrix.transport }}.${{ matrix.tests-chunk }} fi diff --git a/.github/workflows/test-packages-action-linux.yml b/.github/workflows/test-packages-action-linux.yml index 464c9c269670..c7f8d320c2d5 100644 --- a/.github/workflows/test-packages-action-linux.yml +++ b/.github/workflows/test-packages-action-linux.yml @@ -203,11 +203,9 @@ jobs: # --nox-session=${{ inputs.nox-session }}-pkgs --rerun-failures ${{ inputs.distro-slug }} -- ${{ matrix.tests-chunk }} \ # ${{ matrix.version && format('--prev-version={0}', matrix.version) || ''}} - name: Run Package Tests + working-directory: 'D:\a\salt\salt' env: SKIP_REQUIREMENTS_INSTALL: "1" - PRINT_TEST_SELECTION: "0" - PRINT_TEST_PLAN_ONLY: "0" - PRINT_SYSTEM_INFO: "0" RERUN_FAILURES: "1" GITHUB_ACTIONS_PIPELINE: "1" SKIP_INITIAL_GH_ACTIONS_FAILURES: "1" diff --git a/.github/workflows/test-packages-action-windows.yml b/.github/workflows/test-packages-action-windows.yml index a223bc3688bb..e48238ea6056 100644 --- a/.github/workflows/test-packages-action-windows.yml +++ b/.github/workflows/test-packages-action-windows.yml @@ -170,15 +170,9 @@ jobs: - name: Decompress .nox Directory run: | - 7z.exe x nox.windows.${{ inputs.arch }}.tar.gz -so | 7z x -aoa -si -ttar -o"d:/" + nox --force-color -e decompress-dependencies -- windows ${{ inputs.arch }} - #- name: Find and remove pyc files - # shell: bash - # run: | - # find . -name '*.pyc' -delete - # find .nox -name '*.pyc' -delete - - - name: List Packages + - name: List Important Directories run: | dir d:/ dir . @@ -219,8 +213,8 @@ jobs: COVERAGE_CONTEXT: ${{ inputs.distro-slug }} OUTPUT_COLUMNS: "190" PYTHONUTF8: "1" - run: | - nox --force-color -f noxfile.py -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }} \ + run: > + nox --force-color -f noxfile.py -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }} ${{ matrix.version && format('--prev-version={0}', matrix.version) || ''}} - name: Prepare Test Run Artifacts @@ -229,7 +223,7 @@ jobs: run: | # Delete the salt onedir, we won't need it anymore and it will prevent # from it showing in the tree command below - rmdir /S /Qa rtifacts/salt + rmdir /S /Q artifacts/salt tree -a artifacts - name: Upload Test Run Artifacts diff --git a/noxfile.py b/noxfile.py index dff60827d70b..a605db687cc3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1277,7 +1277,10 @@ def decompress_dependencies(session): if not os.path.isabs(resolved_link): # Relative symlinks, resolve them resolved_link = os.path.join(scan_path, resolved_link) - if not os.path.exists(resolved_link): + prefix_check = False + if platform == "windows": + prefix_check = resolved_link.startswith("\\\\?") + if not os.path.exists(resolved_link) or prefix_check: session.log("The symlink %r looks to be broken", resolved_link) # This is a broken link, fix it resolved_link_suffix = resolved_link.split(