Skip to content

Commit

Permalink
Update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dstrates committed Nov 26, 2023
1 parent 283661a commit 3092efb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
7 changes: 3 additions & 4 deletions tests/parse_cloudwatch_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type LogEventMessage struct {
Version string `json:"version"`
Platform string `json:"platform"`
Repo string `json:"repo"`
Scanner string `json:"scanner"`
CloneURL string `json:"cloneUrl"`
Branch string `json:"branch"`
IsDefaultBranch bool `json:"isDefaultBranch"`
Expand Down Expand Up @@ -52,8 +51,8 @@ func TestParsingCloudwatchLog(t *testing.T) {
require.NoError(t, err)

logData := events.CloudwatchLogsData{
Owner: "521464361009",
LogGroup: "/aws/lambda/test-rebel-base-secrets",
Owner: "012345678901", // AWS Account ID
LogGroup: "/aws/lambda/test-function",
LogStream: "2023/09/29/[$LATEST]718af798bded4b048af83eb06e98d572",
SubscriptionFilters: []string{"error-alerts"},
LogEvents: []events.CloudwatchLogsLogEvent{
Expand All @@ -79,7 +78,7 @@ func TestParsingCloudwatchLog(t *testing.T) {
}

cfg := &config.Config{
AWSRegion: "ap-southeast-2",
AWSRegion: "us-east-2",
}

logDetails, logMessage, err := cloudwatch.ProcessCloudWatchLog(ctx, logEvent, cfg)
Expand Down
14 changes: 4 additions & 10 deletions tests/parse_github_url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func TestExtractPathAndLineNumber(t *testing.T) {
func TestFindPartialMatch(t *testing.T) {
repoFunctionMap := map[string]string{
"force": "the-force",
"sith": "the-sith",
"jedi": "jedi-order",
}

Expand All @@ -58,11 +57,6 @@ func TestFindPartialMatch(t *testing.T) {
expectedRepo: "the-force",
expectFound: true,
},
{
partialRepoName: "sith",
expectedRepo: "the-sith",
expectFound: true,
},
{
partialRepoName: "jedi",
expectedRepo: "jedi-order",
Expand Down Expand Up @@ -93,11 +87,11 @@ func TestConstructGitHubURL(t *testing.T) {
expectError bool
}{
{
org: "nullify-platform",
org: "dstrates",
branch: "main",
caller: "cmd/pullrequest/main.go:12",
function: "the-force",
expectedURL: "https://github.com/nullify-platform/the-force/tree/main/",
caller: "cmd/alerter/main.go:59",
function: "cloudwatch-slack-alerts",
expectedURL: "https://github.com/dstrates/cloudwatch-slack-alerts/tree/main/cmd/alerter/main.go",
expectError: false,
},
}
Expand Down

0 comments on commit 3092efb

Please sign in to comment.