Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
fchastanet committed Dec 5, 2023
1 parent 5b37261 commit 7abcd1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 71 deletions.
70 changes: 1 addition & 69 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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()
Expand Down
10 changes: 8 additions & 2 deletions src/_binaries/Git/upgradeGithubRelease.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}
Expand Down

0 comments on commit 7abcd1d

Please sign in to comment.