From 7abcd1da83b712ea9c206cc24b587145d15c9a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chastanet?= Date: Tue, 5 Dec 2023 23:20:07 +0100 Subject: [PATCH] debug --- .github/workflows/lint-test.yml | 70 +-------------------- src/_binaries/Git/upgradeGithubRelease.bats | 10 ++- 2 files changed, 9 insertions(+), 71 deletions(-) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 46e17bd8..d043ee2d 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -15,38 +15,10 @@ jobs: fail-fast: true matrix: vendor: - - ubuntu - alpine bashTarVersion: - - '4.4' - - '5.0' - '5.1' include: - - vendor: ubuntu - bashImage: ubuntu:20.04 - batsOptions: -j 1 - bashTarVersion: 4.4 - runPrecommitTests: false - - vendor: ubuntu - bashImage: ubuntu:20.04 - bashTarVersion: 5.0 - batsOptions: -j 1 - runPrecommitTests: false - - vendor: ubuntu - bashImage: ubuntu:20.04 - bashTarVersion: 5.1 - batsOptions: -j 1 - runPrecommitTests: true - - vendor: alpine - bashTarVersion: 4.4 - bashImage: amd64/bash:4.4-alpine3.18 - batsOptions: -j 1 - runPrecommitTests: false - - vendor: alpine - bashTarVersion: 5.0 - bashImage: amd64/bash:5.0-alpine3.18 - batsOptions: -j 1 - runPrecommitTests: false - vendor: alpine bashTarVersion: 5.1 bashImage: amd64/bash:5.1-alpine3.18 @@ -77,46 +49,6 @@ jobs: with: python-version: 3.9 - - name: Install pre-commit - if: matrix.runPrecommitTests - run: pip install pre-commit - - - uses: ouzi-dev/commit-status-updater@v2 - if: matrix.runPrecommitTests - with: - name: lint - status: pending - - - name: Run pre-commit - if: matrix.runPrecommitTests - run: pre-commit run -a --hook-stage manual - - - name: Archive results - if: matrix.runPrecommitTests && always() - continue-on-error: true - uses: actions/upload-artifact@v3 - with: - name: linter-reports - path: | - megalinter-reports/** - - - name: Create Pull Request - if: matrix.runPrecommitTests && failure() - uses: peter-evans/create-pull-request@v5 - with: - branch: update/pre-commit-fixes - title: lint fixes - commit-message: Auto-update lint fixes - body: | - some auto fixes have been generated during pre-commit run - labels: updates - - - uses: ouzi-dev/commit-status-updater@v2 - if: matrix.runPrecommitTests && always() - with: - name: lint - status: ${{ job.status }} - # Run unit tests - name: run unit tests run: | @@ -134,7 +66,7 @@ jobs: --bash-version "${{matrix.bashTarVersion}}" \ --bash-base-image "${{matrix.bashImage}}" \ --branch-name "${GITHUB_REF##*/}" \ - ${{matrix.batsOptions}} --report-formatter junit -o logs -r src --ci + ${{matrix.batsOptions}} --report-formatter junit -o logs -r src --ci -x --print-output-on-failure --filter Git::upgradeGithubRelease::1Arg - name: Upload Test Results if: always() diff --git a/src/_binaries/Git/upgradeGithubRelease.bats b/src/_binaries/Git/upgradeGithubRelease.bats index 5834ca31..cfc73fb2 100755 --- a/src/_binaries/Git/upgradeGithubRelease.bats +++ b/src/_binaries/Git/upgradeGithubRelease.bats @@ -26,8 +26,14 @@ function Git::upgradeGithubRelease::noArg { #@test assert_output --partial "ERROR - Command upgradeGithubRelease - Argument 'targetFile' should be provided at least 1 time(s)" } -function Git::upgradeGithubRelease::1Arg { #@test - run "${binDir}/upgradeGithubRelease" arg1 2>&1 +function Git::upgradeGithubRelease::1ArgNotWritable { #@test + run "${binDir}/upgradeGithubRelease" /notWritable/arg1 2>&1 + assert_failure 1 + assert_output --partial "FATAL - File /notWritable/arg1 is not writable" +} + +function Git::upgradeGithubRelease::1ArgWritable { #@test + run "${binDir}/upgradeGithubRelease" /tmp/arg1 2>&1 assert_failure 1 assert_output --partial "ERROR - Command upgradeGithubRelease - Argument 'githubUrlPattern' should be provided at least 1 time(s)" }