Skip to content

Commit

Permalink
errour out on init failure, unless we are running functional tests (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
blotus authored Jul 20, 2023
1 parent aef812f commit 2446867
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ func Execute() error {
}
err = w.Init()
if err != nil {
// XXX: this should be a critical but we must be able to continue
// during testing
// return fmt.Errorf("could not initialize waf instance: %w", err)
if os.Getenv("CS_AWS_WAF_BOUNCER_TESTING") == "" {
return fmt.Errorf("could not initialize waf instance: %w", err)
}
log.Errorf("could not initialize waf instance: %v+", err)
}
wafInstances = append(wafInstances, w)
Expand Down
1 change: 1 addition & 0 deletions default.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CROWDSEC_TEST_VERSION="dev"
CROWDSEC_TEST_FLAVORS="full"
CROWDSEC_TEST_NETWORK="net-test"
CS_AWS_WAF_BOUNCER_TESTING=1

0 comments on commit 2446867

Please sign in to comment.