-
Notifications
You must be signed in to change notification settings - Fork 586
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
162 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"os" | ||
) | ||
|
||
var prNum int | ||
var ref string | ||
|
||
func init() { | ||
flag.IntVar(&prNum, "pr", 0, "the number of the pr") | ||
flag.StringVar(&ref, "ref", "", "the github ref") | ||
flag.Parse() | ||
} | ||
|
||
// in the context of a GithubAction workflow, the PR is the event number. So if the ref is not specified | ||
// but the event number is, that means we are running for a PR. If the ref is specified, this means | ||
// we have merged the PR, so we want to use the ref as a tag instead of the PR number. | ||
func main() { | ||
if prNum == 0 && ref == "" { | ||
fmt.Printf("must specify one or bot of [pr, ref]") | ||
os.Exit(1) | ||
} | ||
fmt.Printf(getSimdTag(prNum, ref)) | ||
} | ||
|
||
func getSimdTag(prNum int, ref string) string { | ||
if ref != "" { | ||
return ref | ||
} | ||
return fmt.Sprintf("pr-%d", prNum) | ||
} |
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,29 @@ | ||
package e2e | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
) | ||
|
||
func TestFeeMiddlewareTestSuite(t *testing.T) { | ||
suite.Run(t, new(FeeMiddlewareTestSuite)) | ||
} | ||
|
||
type FeeMiddlewareTestSuite struct { | ||
suite.Suite | ||
} | ||
|
||
func (s *FeeMiddlewareTestSuite) TestPlaceholder() { | ||
tag, ok := os.LookupEnv("SIMD_TAG") | ||
s.Require().True(ok) | ||
s.T().Logf("SIMD_TAG=%s", tag) | ||
|
||
image, ok := os.LookupEnv("SIMD_IMAGE") | ||
s.Require().True(ok) | ||
s.T().Logf("SIMD_IMAGE=%s", image) | ||
|
||
s.T().Logf("Placeholder test") | ||
s.Require().True(true) | ||
} |