-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stencil): add frozen-lockfile flag (#70)
* feat(stencil): add frozen-lockfile flag * skip lockfile on dry-run, unpass lockfile to module resolver for now * add test
- Loading branch information
1 parent
54de16e
commit d7273eb
Showing
12 changed files
with
227 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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,41 @@ | ||
// Copyright 2022 Outreach Corporation. All Rights Reserved. | ||
|
||
// Description: This file contains tests for the configuration pac | ||
|
||
package configuration_test | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/getoutreach/stencil/pkg/configuration" | ||
) | ||
|
||
func ExampleValidateName() { | ||
// Normal name | ||
success := configuration.ValidateName("test") | ||
fmt.Println("success:", success) | ||
|
||
// Invalid name | ||
success = configuration.ValidateName("test.1234") | ||
fmt.Println("success:", success) | ||
|
||
// Output: | ||
// success: true | ||
// success: false | ||
} | ||
|
||
func ExampleNewServiceManifest() { | ||
sm, err := configuration.NewServiceManifest("testdata/service.yaml") | ||
if err != nil { | ||
// handle the error | ||
fmt.Println("error:", err) | ||
return | ||
} | ||
|
||
fmt.Println(sm.Name) | ||
fmt.Println(sm.Arguments) | ||
|
||
// Output: | ||
// testing | ||
// map[hello:world] | ||
} |
This file contains 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,3 @@ | ||
name: testing | ||
arguments: | ||
hello: world |
This file contains 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,27 @@ | ||
// Copyright 2022 Outreach Corporation. All Rights Reserved. | ||
|
||
// Description: Contains tests for the stencil package | ||
|
||
package stencil_test | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/getoutreach/stencil/pkg/stencil" | ||
) | ||
|
||
func ExampleLoadLockfile() { | ||
// Load the lockfile | ||
l, err := stencil.LoadLockfile("testdata") | ||
if err != nil { | ||
// handle the error | ||
fmt.Println(err) | ||
return | ||
} | ||
|
||
fmt.Println(l.Generated.UTC().Format(time.RFC3339Nano)) | ||
|
||
// Output: | ||
// 2022-04-01T00:25:51.047307Z | ||
} |
This file contains 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,4 @@ | ||
version: v1.6.2 | ||
generated: 2022-04-01T00:25:51.047307Z | ||
modules: [] | ||
files: [] |
This file contains 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.