mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 02:28:09 +00:00 
			
		
		
		
	Fix failing TestHCPLinkConnected Test (#19474)
* replace use of os.Unsetenv in test with t.Setenv and remove t.Parallel from test that rely on env being modified. * experiment with using fromJSON function * revert previous experiment * including double quotes in the output value for the string ubuntu-latest * use go run to launch gofumpt
This commit is contained in:
		
							
								
								
									
										2
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @@ -21,7 +21,7 @@ jobs: | |||||||
|           echo 'enterprise=1' >> $GITHUB_OUTPUT |           echo 'enterprise=1' >> $GITHUB_OUTPUT | ||||||
|           echo 'go-tags=ent enterprise' >> $GITHUB_OUTPUT |           echo 'go-tags=ent enterprise' >> $GITHUB_OUTPUT | ||||||
|         else |         else | ||||||
|           echo 'runs-on=ubuntu-latest' >> $GITHUB_OUTPUT |           echo 'runs-on="ubuntu-latest"' >> $GITHUB_OUTPUT | ||||||
|           echo 'enterprise=' >> $GITHUB_OUTPUT |           echo 'enterprise=' >> $GITHUB_OUTPUT | ||||||
|           echo 'go-tags=' >> $GITHUB_OUTPUT |           echo 'go-tags=' >> $GITHUB_OUTPUT | ||||||
|         fi |         fi | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @@ -217,7 +217,7 @@ fmtcheck: | |||||||
| #@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" | #@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" | ||||||
|  |  | ||||||
| fmt: | fmt: | ||||||
| 	find . -name '*.go' | grep -v pb.go | grep -v vendor | xargs gofumpt -w | 	find . -name '*.go' | grep -v pb.go | grep -v vendor | xargs go run mvdan.cc/gofumpt -w | ||||||
|  |  | ||||||
| semgrep: | semgrep: | ||||||
| 	semgrep --include '*.go' --exclude 'vendor' -a -f tools/semgrep . | 	semgrep --include '*.go' --exclude 'vendor' -a -f tools/semgrep . | ||||||
|   | |||||||
| @@ -1,7 +1,6 @@ | |||||||
| package server | package server | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"os" |  | ||||||
| 	"testing" | 	"testing" | ||||||
|  |  | ||||||
| 	"github.com/go-test/deep" | 	"github.com/go-test/deep" | ||||||
| @@ -10,9 +9,9 @@ import ( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| func TestHCPLinkConfig(t *testing.T) { | func TestHCPLinkConfig(t *testing.T) { | ||||||
| 	os.Unsetenv("HCP_CLIENT_ID") | 	t.Setenv("HCP_CLIENT_ID", "") | ||||||
| 	os.Unsetenv("HCP_CLIENT_SECRET") | 	t.Setenv("HCP_CLIENT_SECRET", "") | ||||||
| 	os.Unsetenv("HCP_RESOURCE_ID") | 	t.Setenv("HCP_RESOURCE_ID", "") | ||||||
|  |  | ||||||
| 	config, err := LoadConfigFile("./test-fixtures/hcp_link_config.hcl") | 	config, err := LoadConfigFile("./test-fixtures/hcp_link_config.hcl") | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|   | |||||||
| @@ -8,7 +8,6 @@ import ( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| func TestHCPLinkConnected(t *testing.T) { | func TestHCPLinkConnected(t *testing.T) { | ||||||
| 	t.Parallel() |  | ||||||
| 	cluster := getTestCluster(t, 2) | 	cluster := getTestCluster(t, 2) | ||||||
| 	defer cluster.Cleanup() | 	defer cluster.Cleanup() | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Marc Boudreau
					Marc Boudreau