-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
432 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Coverage Upload | ||
|
||
on: | ||
workflow_run: | ||
workflows: [testing] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
run_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# https://github.com/actions/github-script | ||
# Based on: https://github.com/orgs/community/discussions/34652 | ||
- name: 'Download artifact' | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: context.payload.workflow_run.id, | ||
}); | ||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "coverage-report" | ||
})[0]; | ||
let download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
let fs = require('fs'); | ||
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/coverage-report.zip`, Buffer.from(download.data)); | ||
- name: 'Unzip artifact' | ||
run: unzip coverage-report.zip | ||
# https://github.com/actions/download-artifact | ||
# - name: Download artifact | ||
# id: download-artifact | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# run-id: ${{ github.event.workflow_run.id }} | ||
# https://github.com/codacy/codacy-coverage-reporter-action | ||
# - name: Run codacy-coverage-reporter | ||
# uses: codacy/codacy-coverage-reporter-action@v1 | ||
# with: | ||
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
# coverage-reports: coverage.xml | ||
- name: Publish Code Coverage Results | ||
run: | | ||
auth="--project-token ${{ secrets.CODACY_PROJECT_TOKEN }}" | ||
commit_uuid="--commit-uuid ${{ github.event.workflow_run.head_sha }}" | ||
bash <(curl -Ls https://coverage.codacy.com/get.sh) report $auth $commit_uuid --force-coverage-parser go -r coverage.out --partial &&\ | ||
bash <(curl -Ls https://coverage.codacy.com/get.sh) final $auth $commit_uuid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: testing | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
name: Integration Tests (Cobbler ${{ matrix.cobbler_version }}) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
cobbler_version: | ||
# - d8f60bbf14a838c8c8a1dba98086b223e35fe70a # 3.3.0 - TypeError during import | ||
- f5b0599acce32de4288c76e4f601aece0c664fed # 3.3.1 | ||
# - 9044aa990a94752fa5bd5a24051adde099280bfa # 3.3.2 - Testing Docker Image broken | ||
# - 5c498dbf2af6e3782b37605a477759e1aacc16b2 # 3.3.3 - Testing Docker Image broken | ||
- 3ed865b79ce69fca7464e0957f4bcadcc9917a9d # 3.3.4 | ||
- 718e3256a5989941e8a678404fdea07364255637 # 3.3.5 | ||
- df356046f3cf27be62a61001b982d5983800cfd9 # 3.3.6 | ||
fail-fast: false | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
id: go | ||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get install -y xorriso | ||
- name: Get dependencies | ||
run: | | ||
go mod download | ||
- name: Replace git version hash | ||
run: | | ||
sed -i "s/cobbler_commit=.*/cobbler_commit=${{ matrix.cobbler_version }}/" testing/start.sh | ||
- name: Restore OS ISO | ||
id: cache-iso-restore | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
*.iso | ||
key: ${{ runner.os }}-${{ matrix.cobbler_version }}-iso | ||
- name: Make Test | ||
run: | | ||
make test | ||
- name: Save OS ISO | ||
id: cache-iso-save | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
*.iso | ||
key: ${{ steps.cache-iso-restore.outputs.cache-primary-key }} | ||
# https://github.com/actions/upload-artifact | ||
- name: Upload coverage report to GH artifacts | ||
if: matrix.cobbler_version == 'df356046f3cf27be62a61001b982d5983800cfd9' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-report | ||
path: coverage.out | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,9 @@ docs/_build | |
|
||
# goreleaser | ||
dist/ | ||
|
||
# Tests | ||
testing/cobbler_source/ | ||
extracted_iso_image/ | ||
*.iso | ||
coverage.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/cobbler/cobblerclient" | ||
"testing" | ||
) | ||
|
||
func Test_AclSetupCommand_Adduser(t *testing.T) { | ||
// Arrange | ||
rootCmd := NewRootCmd() | ||
rootCmd.SetArgs([]string{"aclsetup", "--adduser", "cobbler"}) | ||
|
||
// Act | ||
err := rootCmd.Execute() | ||
|
||
// Assert | ||
// TODO: Assert that the command executed | ||
cobblerclient.FailOnError(t, err) | ||
} | ||
|
||
func Test_AclSetupCommand_Addgroup(t *testing.T) { | ||
// Arrange | ||
rootCmd := NewRootCmd() | ||
rootCmd.SetArgs([]string{"aclsetup", "--addgroup", "cobbler"}) | ||
|
||
// Act | ||
err := rootCmd.Execute() | ||
|
||
// Assert | ||
// TODO: Assert that the command executed | ||
cobblerclient.FailOnError(t, err) | ||
} | ||
|
||
func Test_AclSetupCommand_Removeuser(t *testing.T) { | ||
// Arrange | ||
rootCmd := NewRootCmd() | ||
rootCmd.SetArgs([]string{"aclsetup", "--removeuser", "cobbler"}) | ||
|
||
// Act | ||
err := rootCmd.Execute() | ||
|
||
// Assert | ||
// TODO: Assert that the command executed | ||
cobblerclient.FailOnError(t, err) | ||
} | ||
|
||
func Test_AclSetupCommand_Removegroup(t *testing.T) { | ||
// Arrange | ||
rootCmd := NewRootCmd() | ||
rootCmd.SetArgs([]string{"aclsetup", "--removegroup", "cobbler"}) | ||
|
||
// Act | ||
err := rootCmd.Execute() | ||
|
||
// Assert | ||
// TODO: Assert that the command executed | ||
cobblerclient.FailOnError(t, err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cmd | ||
|
||
// TODO: distro report | ||
// TODO: distro report --name=test | ||
// TODO: distro edit | ||
// TODO: distro find | ||
// TODO: distro copy | ||
// TODO: distro rename | ||
// TODO: distro add | ||
// TODO: distro remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cmd | ||
|
||
// TODO: file report | ||
// TODO: file report --name=test | ||
// TODO: file edit | ||
// TODO: file find | ||
// TODO: file copy | ||
// TODO: file rename | ||
// TODO: file add | ||
// TODO: file remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package cmd | ||
|
||
// TODO: hardlink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cmd | ||
|
||
// TODO: image report | ||
// TODO: image report --name=test | ||
// TODO: image edit | ||
// TODO: image find | ||
// TODO: image copy | ||
// TODO: image rename | ||
// TODO: image add | ||
// TODO: image remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package cmd | ||
|
||
// TODO: list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cmd | ||
|
||
// TODO: menu report | ||
// TODO: menu report --name=test | ||
// TODO: menu edit | ||
// TODO: menu find | ||
// TODO: menu copy | ||
// TODO: menu rename | ||
// TODO: menu add | ||
// TODO: menu remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cmd | ||
|
||
// TODO: mgmtclass report | ||
// TODO: mgmtclass report --name=test | ||
// TODO: mgmtclass edit | ||
// TODO: mgmtclass find | ||
// TODO: mgmtclass copy | ||
// TODO: mgmtclass rename | ||
// TODO: mgmtclass add | ||
// TODO: mgmtclass remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cmd | ||
|
||
// TODO: package report | ||
// TODO: package report --name=test | ||
// TODO: package edit | ||
// TODO: package find | ||
// TODO: package copy | ||
// TODO: package rename | ||
// TODO: package add | ||
// TODO: package remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cmd | ||
|
||
// TODO: profile report | ||
// TODO: profile report --name=test | ||
// TODO: profile edit | ||
// TODO: profile find | ||
// TODO: profile copy | ||
// TODO: profile rename | ||
// TODO: profile add | ||
// TODO: profile remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cmd | ||
|
||
// TODO: repo report | ||
// TODO: repo report --name=test | ||
// TODO: repo edit | ||
// TODO: repo find | ||
// TODO: repo copy | ||
// TODO: repo rename | ||
// TODO: repo add | ||
// TODO: repo remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package cmd | ||
|
||
// TODO: report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package cmd | ||
|
||
// TODO: reposync | ||
// TODO: reposync --tries=3 | ||
// TODO: reposync --no-fail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package cmd | ||
|
||
// TODO: signature update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package cmd | ||
|
||
// TODO: sync | ||
// TODO: sync --dns | ||
// TODO: sync --dhcp | ||
// TODO: sync --dhcp --dns | ||
// TODO: sync --systems=a.b.c,a.d.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cmd | ||
|
||
// TODO: system report | ||
// TODO: system report --name=test | ||
// TODO: system edit | ||
// TODO: system find | ||
// TODO: system copy | ||
// TODO: system rename | ||
// TODO: system add | ||
// TODO: system remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package cmd | ||
|
||
// TODO: validate-autoinstalls |
Oops, something went wrong.