Rename test folder to tests

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Carlos Eduardo Arango Gutierrez 2025-01-21 11:00:25 +01:00 committed by Evan Lezar
parent 069926e4b6
commit 868f385a01
No known key found for this signature in database
7 changed files with 100 additions and 54 deletions

128
.github/dependabot.yml vendored
View File

@ -3,63 +3,43 @@
version: 2 version: 2
updates: updates:
# main branch
- package-ecosystem: "gomod" - package-ecosystem: "gomod"
target-branch: main target-branch: main
directory: "/" directories:
schedule: - "/"
interval: "weekly" - "deployments/devel"
day: "sunday" - "tests"
ignore:
- dependency-name: k8s.io/*
labels:
- dependencies
- package-ecosystem: "docker"
target-branch: main
directory: "/deployments/container"
schedule:
interval: "daily"
- package-ecosystem: "gomod"
# This defines a specific dependabot rule for the latest release-* branch.
target-branch: release-1.16
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
ignore:
- dependency-name: k8s.io/*
labels:
- dependencies
- maintenance
- package-ecosystem: "docker"
target-branch: release-1.16
directory: "/deployments/container"
schedule: schedule:
interval: "daily" interval: "daily"
labels: labels:
- dependencies - dependencies
- maintenance groups:
k8sio:
patterns:
- k8s.io/*
exclude-patterns:
- k8s.io/klog/*
- package-ecosystem: "gomod"
target-branch: main
directory: "deployments/devel"
schedule:
interval: "weekly"
day: "sunday"
# A dependabot rule to bump the golang version.
- package-ecosystem: "docker" - package-ecosystem: "docker"
target-branch: main target-branch: main
directory: "/deployments/devel" directories:
# CUDA image
- "/deployments/container"
# Golang version
- "/deployments/devel"
schedule: schedule:
interval: "daily" interval: "daily"
labels:
- dependencies
- package-ecosystem: "github-actions" - package-ecosystem: "github-actions"
target-branch: main
directory: "/" directory: "/"
schedule: schedule:
interval: "daily" interval: "daily"
labels:
- dependencies
# Allow dependabot to update the libnvidia-container submodule. # Allow dependabot to update the libnvidia-container submodule.
- package-ecosystem: "gitsubmodule" - package-ecosystem: "gitsubmodule"
@ -72,3 +52,69 @@ updates:
labels: labels:
- dependencies - dependencies
- libnvidia-container - libnvidia-container
# The release branch(es):
- package-ecosystem: "gomod"
target-branch: release-1.17
directories:
- "/"
# We don't update development or test dependencies on release branches
# - "deployments/devel"
# - "tests"
schedule:
interval: "weekly"
day: "sunday"
labels:
- dependencies
- maintenance
ignore:
# For release branches we only consider patch updates.
- dependency-name: "*"
update-types:
- version-update:semver-major
- version-update:semver-minor
groups:
k8sio:
patterns:
- k8s.io/*
exclude-patterns:
- k8s.io/klog/*
- package-ecosystem: "docker"
target-branch: release-1.17
directories:
# CUDA image
- "/deployments/container"
# Golang version
- "/deployments/devel"
schedule:
interval: "weekly"
day: "sunday"
ignore:
# For release branches we only apply patch updates to the golang version.
- dependency-name: "*golang*"
update-types:
- version-update:semver-major
- version-update:semver-minor
labels:
- dependencies
- maintenance
- package-ecosystem: "github-actions"
target-branch: release-1.17
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
labels:
- dependencies
- maintenance
# Github actions need to be gh-pages branches.
- package-ecosystem: "github-actions"
target-branch: gh-pages
directory: "/"
schedule:
interval: "daily"
labels:
- dependencies

2
.gitignore vendored
View File

@ -3,7 +3,7 @@ artifacts
*.swp *.swp
*.swo *.swo
/coverage.out* /coverage.out*
/test/output/ /tests/output/
/nvidia-container-runtime /nvidia-container-runtime
/nvidia-container-runtime.* /nvidia-container-runtime.*
/nvidia-container-runtime-hook /nvidia-container-runtime-hook

View File

@ -34,7 +34,7 @@ environment variables.
## Testing packages locally ## Testing packages locally
The [test/release](./test/release/) folder contains documentation on how the installation of local or staged packages can be tested. The [tests/release](./tests/release/) folder contains documentation on how the installation of local or staged packages can be tested.
## Releasing ## Releasing

View File

@ -22,9 +22,9 @@ import (
const ( const (
nvidiaRuntime = "nvidia-container-runtime" nvidiaRuntime = "nvidia-container-runtime"
nvidiaHook = "nvidia-container-runtime-hook" nvidiaHook = "nvidia-container-runtime-hook"
bundlePathSuffix = "test/output/bundle/" bundlePathSuffix = "tests/output/bundle/"
specFile = "config.json" specFile = "config.json"
unmodifiedSpecFileSuffix = "test/input/test_spec.json" unmodifiedSpecFileSuffix = "tests/input/test_spec.json"
) )
const ( const (
@ -46,8 +46,8 @@ func TestMain(m *testing.M) {
if err != nil { if err != nil {
log.Fatalf("error in test setup: could not get module root: %v", err) log.Fatalf("error in test setup: could not get module root: %v", err)
} }
testBinPath := filepath.Join(moduleRoot, "test", "bin") testBinPath := filepath.Join(moduleRoot, "tests", "bin")
testInputPath := filepath.Join(moduleRoot, "test", "input") testInputPath := filepath.Join(moduleRoot, "tests", "input")
// Set the environment variables for the test // Set the environment variables for the test
os.Setenv("PATH", test.PrependToPath(testBinPath, moduleRoot)) os.Setenv("PATH", test.PrependToPath(testBinPath, moduleRoot))

View File

@ -19,14 +19,14 @@ func TestMaintainSpec(t *testing.T) {
} }
for _, f := range files { for _, f := range files {
inputSpecPath := filepath.Join(moduleRoot, "test/input", f) inputSpecPath := filepath.Join(moduleRoot, "tests/input", f)
spec := NewFileSpec(inputSpecPath).(*fileSpec) spec := NewFileSpec(inputSpecPath).(*fileSpec)
_, err := spec.Load() _, err := spec.Load()
require.NoError(t, err) require.NoError(t, err)
outputSpecPath := filepath.Join(moduleRoot, "test/output", f) outputSpecPath := filepath.Join(moduleRoot, "tests/output", f)
spec.path = outputSpecPath spec.path = outputSpecPath
spec.Flush() spec.Flush()

View File

@ -36,7 +36,7 @@ func TestGetFileList(t *testing.T) {
}{ }{
{ {
description: "returns list of CSV files", description: "returns list of CSV files",
root: "test/input/csv_samples/", root: "tests/input/csv_samples/",
files: []string{ files: []string{
"jetson.csv", "jetson.csv",
"simple_wrong.csv", "simple_wrong.csv",
@ -46,15 +46,15 @@ func TestGetFileList(t *testing.T) {
}, },
{ {
description: "handles empty folder", description: "handles empty folder",
root: "test/input/csv_samples/empty", root: "tests/input/csv_samples/empty",
}, },
{ {
description: "handles non-existent folder", description: "handles non-existent folder",
root: "test/input/csv_samples/NONEXISTENT", root: "tests/input/csv_samples/NONEXISTENT",
}, },
{ {
description: "handles non-existent folder root", description: "handles non-existent folder root",
root: "/NONEXISTENT/test/input/csv_samples/", root: "/NONEXISTENT/tests/input/csv_samples/",
}, },
} }

View File

@ -46,7 +46,7 @@ func TestMain(m *testing.M) {
if err != nil { if err != nil {
log.Fatalf("error in test setup: could not get module root: %v", err) log.Fatalf("error in test setup: could not get module root: %v", err)
} }
testBinPath := filepath.Join(moduleRoot, "test", "bin") testBinPath := filepath.Join(moduleRoot, "tests", "bin")
// Set the environment variables for the test // Set the environment variables for the test
os.Setenv("PATH", test.PrependToPath(testBinPath, moduleRoot)) os.Setenv("PATH", test.PrependToPath(testBinPath, moduleRoot))