mirror of
https://github.com/actions/actions-runner-controller.git
synced 2026-01-16 16:59:15 +08:00
moving to chart tests
This commit is contained in:
24
charts/gha-runner-scale-set-dev/.helmignore
Normal file
24
charts/gha-runner-scale-set-dev/.helmignore
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
|
tests/
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package tests
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/gruntwork-io/terratest/modules/helm"
|
||||||
|
"github.com/gruntwork-io/terratest/modules/logger"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestAutoscalingRunnerSetLabels(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
t.Run("should set default labels", func(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
options := &helm.Options{
|
||||||
|
Logger: logger.Discard,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
suite: "AutoscalingRunnerSet"
|
||||||
|
templates:
|
||||||
|
- autoscalingrunnserset.yaml
|
||||||
|
tests:
|
||||||
|
- it: should render base labels
|
||||||
|
set:
|
||||||
|
scaleset.name: "test"
|
||||||
|
auth.url: "https://github.com/org"
|
||||||
|
auth.githubToken: "gh_"
|
||||||
27
charts/gha-runner-scale-set-dev/tests/tests_test.go
Normal file
27
charts/gha-runner-scale-set-dev/tests/tests_test.go
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package tests
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/gruntwork-io/terratest/modules/random"
|
||||||
|
)
|
||||||
|
|
||||||
|
var chartPath string
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var err error
|
||||||
|
chartPath, err = filepath.Abs("../../gha-runner-scale-set-dev")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// generateNamespace generates namespace with given prefix
|
||||||
|
// If prefix is not specified, a default prefix "test-" is used
|
||||||
|
func generateNamespace(prefix string) string {
|
||||||
|
if prefix == "" {
|
||||||
|
prefix = "test-"
|
||||||
|
}
|
||||||
|
return prefix + strings.ToLower(random.UniqueId())
|
||||||
|
}
|
||||||
@@ -21,3 +21,4 @@
|
|||||||
.idea/
|
.idea/
|
||||||
*.tmproj
|
*.tmproj
|
||||||
.vscode/
|
.vscode/
|
||||||
|
tests/
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
suite: "AutoscalingRunnerSet"
|
||||||
|
templates:
|
||||||
|
- autoscalingrunnserset.yaml
|
||||||
|
tests:
|
||||||
|
- it: should render base labels
|
||||||
|
set:
|
||||||
|
scaleset.name: "test"
|
||||||
|
auth.url: "https://github.com/org"
|
||||||
|
auth.githubToken: "gh_"
|
||||||
Reference in New Issue
Block a user