-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
34 additions
and
43 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 |
---|---|---|
|
@@ -47,19 +47,19 @@ var ( | |
} | ||
) | ||
|
||
func createMockEnv() { | ||
os.Setenv("VELA_BUILD_CREATED", "1556720958") | ||
os.Setenv("VELA_BUILD_ENQUEUED", "1556720958") | ||
os.Setenv("VELA_BUILD_FINISHED", "1556720958") | ||
os.Setenv("VELA_BUILD_STARTED", "1556720958") | ||
os.Setenv("VELA_BUILD_AUTHOR", "octocat") | ||
os.Setenv("VELA_BUILD_AUTHOR_EMAIL", "[email protected]") | ||
os.Setenv("VELA_BUILD_BRANCH", "main") | ||
os.Setenv("VELA_BUILD_COMMIT", "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d") | ||
os.Setenv("VELA_BUILD_LINK", "https://vela-server.localhost/octocat/hello-world/1") | ||
os.Setenv("VELA_BUILD_MESSAGE", "Merge pull request #6 from octocat/patch-1") | ||
os.Setenv("VELA_BUILD_NUMBER", "1") | ||
os.Setenv("VELA_REPO_FULL_NAME", "octocat/hello-world") | ||
func createMockEnv(t *testing.T) { | ||
t.Setenv("VELA_BUILD_CREATED", "1556720958") | ||
t.Setenv("VELA_BUILD_ENQUEUED", "1556720958") | ||
t.Setenv("VELA_BUILD_FINISHED", "1556720958") | ||
t.Setenv("VELA_BUILD_STARTED", "1556720958") | ||
t.Setenv("VELA_BUILD_AUTHOR", "octocat") | ||
t.Setenv("VELA_BUILD_AUTHOR_EMAIL", "[email protected]") | ||
t.Setenv("VELA_BUILD_BRANCH", "main") | ||
t.Setenv("VELA_BUILD_COMMIT", "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d") | ||
t.Setenv("VELA_BUILD_LINK", "https://vela-server.localhost/octocat/hello-world/1") | ||
t.Setenv("VELA_BUILD_MESSAGE", "Merge pull request #6 from octocat/patch-1") | ||
t.Setenv("VELA_BUILD_NUMBER", "1") | ||
t.Setenv("VELA_REPO_FULL_NAME", "octocat/hello-world") | ||
} | ||
|
||
func TestValidateSuccess(t *testing.T) { | ||
|
@@ -339,7 +339,7 @@ func TestInjectEnvSuccess(t *testing.T) { | |
t.Errorf("Validate() should not have raised an error: %s", err) | ||
t.FailNow() | ||
} | ||
createMockEnv() | ||
createMockEnv(t) | ||
subject, err := test.parameters.injectEnv(test.parameters.Email.Subject) | ||
if err != nil { | ||
t.Errorf("InjectEnv(subject) should not have raised an error %s", err) | ||
|
@@ -393,8 +393,8 @@ func TestInjectEnvBadVar(t *testing.T) { | |
t.Errorf("Validate() should not have raised an error: %s", err) | ||
t.FailNow() | ||
} | ||
createMockEnv() | ||
os.Setenv("SOME_OTHER_VARIABLE", "check") | ||
createMockEnv(t) | ||
t.Setenv("SOME_OTHER_VARIABLE", "check") | ||
subject, err := test.parameters.injectEnv(test.parameters.Email.Subject) | ||
|
||
if err != nil { | ||
|
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 |
---|---|---|
@@ -1,14 +1,23 @@ | ||
module github.com/go-vela/vela-email | ||
|
||
go 1.14 | ||
go 1.18 | ||
|
||
require ( | ||
github.com/Masterminds/semver/v3 v3.1.1 | ||
github.com/PuerkitoBio/goquery v1.8.0 // indirect | ||
github.com/aymerick/douceur v0.2.0 | ||
github.com/go-vela/types v0.14.0 | ||
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible | ||
github.com/sirupsen/logrus v1.9.0 | ||
github.com/urfave/cli/v2 v2.11.1 | ||
) | ||
|
||
require ( | ||
github.com/PuerkitoBio/goquery v1.8.0 // indirect | ||
github.com/andybalholm/cascadia v1.3.1 // indirect | ||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect | ||
github.com/gorilla/css v1.0.0 // indirect | ||
github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect | ||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect | ||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect | ||
) |
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