test: Run unit tests on push
s
This commit is contained in:
1 parent
cb6a2b5350
commit
714c26721d
5 files changed
+51
-62
No files matched your search
@@ -0,0 +1,21 @@
|
|||||||
|
name: test
|
||||||
|
|
||||||
|
on:
|
||||||
|
- workflow_dispatch
|
||||||
|
- push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
- name: Set up Go Environment
|
||||||
|
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
cache: true
|
||||||
|
- name: Run Tests
|
||||||
|
run: go test -v ./...
|
||||||
+22
-1
@@ -1,2 +1,23 @@
|
|||||||
|
### IntelliJ IDEA project files ###
|
||||||
|
.idea
|
||||||
|
*.ipr
|
||||||
|
*.iml
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
### Visual Studio ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### macOS ###
|
||||||
|
# General
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
### TF files ###
|
||||||
|
.terraform*
|
||||||
|
terraform.tfstate*
|
||||||
|
plan.tfplan
|
||||||
|
|
||||||
|
### Secrets used in testing ###
|
||||||
secrets/
|
secrets/
|
||||||
secrets.json
|
secrets.json
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# These owners will be the default owners for everything in
|
||||||
|
# the repo, unless a later match takes precedence.
|
||||||
|
|
||||||
|
@hashicorp/boundary
|
||||||
@@ -9,11 +9,11 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
cred "github.com/hashicorp/boundary-plugin-google/internal/credential"
|
||||||
"github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/hostcatalogs"
|
"github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/hostcatalogs"
|
||||||
"github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/hostsets"
|
"github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/hostsets"
|
||||||
pb "github.com/hashicorp/boundary/sdk/pbs/plugin"
|
pb "github.com/hashicorp/boundary/sdk/pbs/plugin"
|
||||||
"github.com/hashicorp/go-secure-stdlib/parseutil"
|
"github.com/hashicorp/go-secure-stdlib/parseutil"
|
||||||
cred "github.com/hashicorp/boundary-plugin-google/internal/credential"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"google.golang.org/protobuf/types/known/structpb"
|
"google.golang.org/protobuf/types/known/structpb"
|
||||||
)
|
)
|
||||||
@@ -26,6 +26,7 @@ func wrapMap(t *testing.T, in map[string]interface{}) *structpb.Struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestListHosts(t *testing.T) {
|
func TestListHosts(t *testing.T) {
|
||||||
|
t.Skip("TODO: this needs a secrets file to run - maybe only manually?")
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
p := &GooglePlugin{}
|
p := &GooglePlugin{}
|
||||||
|
|
||||||
@@ -294,6 +295,7 @@ func TestListHosts(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateCatalog(t *testing.T) {
|
func TestCreateCatalog(t *testing.T) {
|
||||||
|
t.Skip("TODO: this needs a secrets file to run - maybe only manually?")
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
p := &GooglePlugin{}
|
p := &GooglePlugin{}
|
||||||
|
|
||||||
@@ -374,6 +376,7 @@ func TestCreateCatalog(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestUpdateCatalog(t *testing.T) {
|
func TestUpdateCatalog(t *testing.T) {
|
||||||
|
t.Skip("TODO: this needs a secrets file to run - maybe only manually?")
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
p := &GooglePlugin{}
|
p := &GooglePlugin{}
|
||||||
|
|
||||||
|
|||||||
Generated
-60
@@ -1,60 +0,0 @@
|
|||||||
# This file is maintained automatically by "terraform init".
|
|
||||||
# Manual edits may be lost in future updates.
|
|
||||||
|
|
||||||
provider "registry.terraform.io/hashicorp/google" {
|
|
||||||
version = "5.22.0"
|
|
||||||
constraints = "~> 5.22.0"
|
|
||||||
hashes = [
|
|
||||||
"h1:xqblL05dpHyV4LxnIwCnHd28we8yIOBFsNGi6BqUxEY=",
|
|
||||||
"zh:12fce1e8b7d4cfb150142185ce99165ca3854526f7d826106ec09ba77ef9bab1",
|
|
||||||
"zh:1ecaff54cf7fecc41d89b130a066e903fd1353a1a476c816ad2b2013b1664776",
|
|
||||||
"zh:294091d1d0b87b99f9bdfdd42eae769fa44930680a3cefff0ff2f43741fefa53",
|
|
||||||
"zh:373e7a4127c7fef671a226764bb5f5ebc94823b19f65d8e2370b4c75e43eb2b3",
|
|
||||||
"zh:7121c14b7a59b07386d09e9ca19160a453680c32708f1132e904d56f8c697a65",
|
|
||||||
"zh:7d8316fec69a284dae43b3f107798e62478b8d1de9b3197e45b49e99b14bfc27",
|
|
||||||
"zh:8186df47dcbf112dfd54e3310056a955c422277ccbe369f6074f8c65ecb724dc",
|
|
||||||
"zh:967dc4f14fb1ad1673befd3e40a181a0bf18cb212822cab1dc9f8b44235fc766",
|
|
||||||
"zh:9dac1ec8aa80c49189e2dd59ce338c14330da685782fcb261e62c2b2d1b90e26",
|
|
||||||
"zh:c309f86d35945c02ed2fdb71348cd03fc99a6aaeedfad035b01bad78222e3eda",
|
|
||||||
"zh:eb46d32b5fa33d8fa7e2cded4ea5b815d66a202754a7afc8ad7c93aa08d13919",
|
|
||||||
"zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
provider "registry.terraform.io/hashicorp/local" {
|
|
||||||
version = "2.5.1"
|
|
||||||
hashes = [
|
|
||||||
"h1:tjcGlQAFA0kmQ4vKkIPPUC4it1UYxLbg4YvHOWRAJHA=",
|
|
||||||
"zh:0af29ce2b7b5712319bf6424cb58d13b852bf9a777011a545fac99c7fdcdf561",
|
|
||||||
"zh:126063ea0d79dad1f68fa4e4d556793c0108ce278034f101d1dbbb2463924561",
|
|
||||||
"zh:196bfb49086f22fd4db46033e01655b0e5e036a5582d250412cc690fa7995de5",
|
|
||||||
"zh:37c92ec084d059d37d6cffdb683ccf68e3a5f8d2eb69dd73c8e43ad003ef8d24",
|
|
||||||
"zh:4269f01a98513651ad66763c16b268f4c2da76cc892ccfd54b401fff6cc11667",
|
|
||||||
"zh:51904350b9c728f963eef0c28f1d43e73d010333133eb7f30999a8fb6a0cc3d8",
|
|
||||||
"zh:73a66611359b83d0c3fcba2984610273f7954002febb8a57242bbb86d967b635",
|
|
||||||
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
|
|
||||||
"zh:7ae387993a92bcc379063229b3cce8af7eaf082dd9306598fcd42352994d2de0",
|
|
||||||
"zh:9e0f365f807b088646db6e4a8d4b188129d9ebdbcf2568c8ab33bddd1b82c867",
|
|
||||||
"zh:b5263acbd8ae51c9cbffa79743fbcadcb7908057c87eb22fd9048268056efbc4",
|
|
||||||
"zh:dfcd88ac5f13c0d04e24be00b686d069b4879cc4add1b7b1a8ae545783d97520",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
provider "registry.terraform.io/hashicorp/tls" {
|
|
||||||
version = "4.0.5"
|
|
||||||
hashes = [
|
|
||||||
"h1:yLqz+skP3+EbU3yyvw8JqzflQTKDQGsC9QyZAg+S4dg=",
|
|
||||||
"zh:01cfb11cb74654c003f6d4e32bbef8f5969ee2856394a96d127da4949c65153e",
|
|
||||||
"zh:0472ea1574026aa1e8ca82bb6df2c40cd0478e9336b7a8a64e652119a2fa4f32",
|
|
||||||
"zh:1a8ddba2b1550c5d02003ea5d6cdda2eef6870ece86c5619f33edd699c9dc14b",
|
|
||||||
"zh:1e3bb505c000adb12cdf60af5b08f0ed68bc3955b0d4d4a126db5ca4d429eb4a",
|
|
||||||
"zh:6636401b2463c25e03e68a6b786acf91a311c78444b1dc4f97c539f9f78de22a",
|
|
||||||
"zh:76858f9d8b460e7b2a338c477671d07286b0d287fd2d2e3214030ae8f61dd56e",
|
|
||||||
"zh:a13b69fb43cb8746793b3069c4d897bb18f454290b496f19d03c3387d1c9a2dc",
|
|
||||||
"zh:a90ca81bb9bb509063b736842250ecff0f886a91baae8de65c8430168001dad9",
|
|
||||||
"zh:c4de401395936e41234f1956ebadbd2ed9f414e6908f27d578614aaa529870d4",
|
|
||||||
"zh:c657e121af8fde19964482997f0de2d5173217274f6997e16389e7707ed8ece8",
|
|
||||||
"zh:d68b07a67fbd604c38ec9733069fbf23441436fecf554de6c75c032f82e1ef19",
|
|
||||||
"zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user