-
Notifications
You must be signed in to change notification settings - Fork 26
Route kiln test through docker-virtual registry and refactor test-script generation #643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b910390
Default kiln test to docker-virtual Artifactory path
rizwanreza 9d9fac2
Improve kiln test UX: Dockerfile caching, suite headers, GOMAXPROCS
rizwanreza a59703d
Refactor commands() into testPlan with per-suite exit tracking and su…
rizwanreza edd3cbe
Add --verbose flag: timestamps, quiet npm by default
rizwanreza ba05565
Rename Configuration.RunMetadata to RunStability
rizwanreza 6ca9e9a
Eliminate double decodeEnvironment call in runTest
rizwanreza 15ae184
Decompose runTest into buildTestImage and startAndWaitContainer
rizwanreza b80e9da
Fix GingkoFlags typo: rename to GinkgoFlags
rizwanreza 7c36e19
Move verbose out of testPlan; pass as parameter to script()
rizwanreza 77093c8
Replace fmt.Errorf(\"%s\", detail) with errors.New in checkImageBuild…
rizwanreza ec6287f
Fix errcheck lint: explicitly discard progress write return values
rizwanreza e086957
Fix timestamps in non-verbose summary footer
rizwanreza d219e71
Update --verbose flag description to reflect actual behaviour
rizwanreza 97b16f1
Add NPM virtual proxy
rizwanreza fe19ecb
Use t.Setenv for Artifactory credential cleanup in test
rizwanreza e4db702
Simplify checkImageBuildResponse to take one argument
rizwanreza 2e8ab04
Pass Verbose flag and clean up setupTestRepo in integration test
rizwanreza a1fd222
Merge main and bump Ruby base image to 4.0.3
rizwanreza 19eebd5
Restore verbose image build output in kiln test
rizwanreza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 commands | ||
|
|
||
| import ( | ||
| "context" | ||
| "io" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
|
|
||
| "github.com/pivotal-cf/kiln/internal/test" | ||
| ) | ||
|
|
||
| func TestTileTest_RequiresArtifactoryCredentials(t *testing.T) { | ||
| t.Setenv("ARTIFACTORY_USERNAME", "") | ||
| t.Setenv("ARTIFACTORY_PASSWORD", "") | ||
|
|
||
| err := NewTileTest().Execute([]string{}) | ||
| require.Error(t, err) | ||
| require.ErrorContains(t, err, "ARTIFACTORY_USERNAME") | ||
| require.ErrorContains(t, err, "kiln test") | ||
| } | ||
|
|
||
| func TestTileTest_RequiresArtifactoryPassword(t *testing.T) { | ||
| t.Setenv("ARTIFACTORY_PASSWORD", "") | ||
|
|
||
| err := NewTileTest().Execute([]string{"-e", "ARTIFACTORY_USERNAME=onlyuser"}) | ||
| require.Error(t, err) | ||
| require.ErrorContains(t, err, "ARTIFACTORY_PASSWORD") | ||
| } | ||
|
|
||
| func TestTileTest_PassesArtifactoryViaEnvironmentToConfiguration(t *testing.T) { | ||
| var captured test.Configuration | ||
| stub := func(_ context.Context, _ io.Writer, c test.Configuration) error { | ||
| captured = c | ||
| return nil | ||
| } | ||
| err := NewTileTestWithCollaborators(io.Discard, stub).Execute([]string{ | ||
| "-e", "ARTIFACTORY_USERNAME=u", | ||
| "-e", "ARTIFACTORY_PASSWORD=p", | ||
| }) | ||
| require.NoError(t, err) | ||
| require.Contains(t, captured.Environment, "ARTIFACTORY_USERNAME=u") | ||
| require.Contains(t, captured.Environment, "ARTIFACTORY_PASSWORD=p") | ||
| } | ||
|
|
||
| func TestTileTest_UsesProcessEnvArtifactoryCredentials(t *testing.T) { | ||
| t.Setenv("ARTIFACTORY_USERNAME", "fromenv") | ||
| t.Setenv("ARTIFACTORY_PASSWORD", "frompass") | ||
|
|
||
| var captured test.Configuration | ||
| stub := func(_ context.Context, _ io.Writer, c test.Configuration) error { | ||
| captured = c | ||
| return nil | ||
| } | ||
| err := NewTileTestWithCollaborators(io.Discard, stub).Execute([]string{}) | ||
| require.NoError(t, err) | ||
| require.Empty(t, captured.Environment) | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the BeforeEach() set these environment variables before every test is executed? If so, we might be able to get away with
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I like this!!