Skip to content

Commit

Permalink
Merge pull request #306 from stgraber/main
Browse files Browse the repository at this point in the history
Test bugfixes and typos
  • Loading branch information
freeekanayaka committed Dec 15, 2023
2 parents 37fbbe2 + ab5bee1 commit 1719ffc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feel free to remove anything which doesn't apply to you and add more information

* Distribution:
* Distribution version:
* The output of "inc info" or if that fails:
* The output of "incus info" or if that fails:
* Kernel version:
* LXC version:
* Incus version:
Expand All @@ -30,8 +30,8 @@ see happen.
# Information to attach

- [ ] Any relevant kernel output (`dmesg`)
- [ ] Container log (`inc info NAME --show-log`)
- [ ] Container configuration (`inc config show NAME --expanded`)
- [ ] Main daemon log (at /var/log/incus/incus.log)
- [ ] Container log (`incus info NAME --show-log`)
- [ ] Container configuration (`incus config show NAME --expanded`)
- [ ] Main daemon log (at /var/log/incus/incusd.log)
- [ ] Output of the client with --debug
- [ ] Output of the daemon with --debug (alternatively output of `inc monitor` while reproducing the issue)
- [ ] Output of the daemon with --debug (alternatively output of `incus monitor --pretty` while reproducing the issue)
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:
make
- name: Run static analysis
env:
GITHUB_BEFORE: ${{ github.event.before }}
run: |
make static-analysis
Expand Down
4 changes: 2 additions & 2 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Name | Default | Description
`INCUS_CEPH_CEPHFS` | "" | Enables the CephFS tests using the specified cephfs filesystem for `cephfs` pools
`INCUS_CEPH_CEPHOBJECT_RADOSGW` | "" | Enables the Ceph Object tests using the specified radosgw HTTP endpoint for `cephobject` pools
`INCUS_CONCURRENT` | 0 | Run concurrency tests, very CPU intensive
`INCUS_DEBUG` | 0 | Run incus, inc and the shell in debug mode (very verbose)
`INCUS_DEBUG` | 0 | Run incusd, incus and the shell in debug mode (very verbose)
`INCUS_INSPECT` | 0 | Don't teardown the test environment on failure
`INCUS_LOGS ` | "" | Path to a directory to copy all the Incus logs to
`INCUS_OFFLINE` | 0 | Skip anything that requires network access
Expand All @@ -29,4 +29,4 @@ Name | Default | Description
`INCUS_IB_SRIOV_PARENT` | "" | Enables Infiniband SR-IOV tests using the specified parent device
`INCUS_NIC_BRIDGED_DRIVER` | "" | Specifies bridged NIC driver for tests (either native or openvswitch, defaults to native)
`INCUS_REQUIRED_TESTS` | "" | Space-delimited list of test names that must not be skipped if their prerequisites are not met
`INCUS_VERBOSE` | 0 | Run incus, inc and the shell in verbose mode
`INCUS_VERBOSE` | 0 | Run incusd, incus and the shell in verbose mode
26 changes: 21 additions & 5 deletions test/lint/golangci.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
#!/bin/sh -eu

# Default target branch.
target_branch="main"
if [ -n "${GITHUB_ACTIONS:-}" ]; then
# Target branch when running in github actions (see https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables).
target_branch=""
if [ -n "${GITHUB_BASE_REF:-}" ]; then
# Target branch when scanning a Github pull request
target_branch="${GITHUB_BASE_REF}"
elif [ -n "${GITHUB_BEFORE:-}" ]; then
# Target branch when scanning a Github merge
target_branch="${GITHUB_BEFORE}"
elif [ -n "${1:-}" ]; then
# Allow a target branch parameter.
target_branch="${1}"
else
# Default target branch.
for branch in main origin lxc/main; do
if git show-ref --quiet "refs/heads/${branch}" >/dev/null 2>&1; then
target_branch="${branch}"
break
fi
done
fi

# Check if we found a target branch.
if [ -z "${target_branch}" ]; then
echo "The target branch for golangci couldn't be found, skipping."
return
fi

# Gets the most recent commit hash from the target branch.
rev="$(git log "${target_branch}" --oneline --no-abbrev-commit -n1 | cut -d' ' -f1)"

echo "Checking for golangci-lint errors between HEAD and ${target_branch}..."
golangci-lint run --timeout 5m --new --new-from-rev "${rev}"
golangci-lint run --timeout 5m --new --new-from-rev "${rev}"

0 comments on commit 1719ffc

Please sign in to comment.