-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: updated to use config via viper (#8)
* feat: updated to use config via viper * feat: Reconciled changes with main * Feat: Add support for checking PR message format (#25) - fixes #24 Signed-off-by: Anoop Gopalakrishnan <[email protected]> * Create codeql.yml (#27) * Feat: Add container scanning workflow Signed-off-by: Anoop Gopalakrishnan <[email protected]> * Fix: Run scorecard on every push to main Signed-off-by: Anoop Gopalakrishnan <[email protected]> * Fix: Use correct go version in codeql analysis - Remove temp branch from build workflow --------- Signed-off-by: Anoop Gopalakrishnan <[email protected]> Co-authored-by: Finsen Varghese <[email protected]> Co-authored-by: Anoop Gopalakrishnan <[email protected]> Co-authored-by: Anoop Gopalakrishnan <[email protected]>
- Loading branch information
1 parent
1f09cfa
commit 9d07bef
Showing
6 changed files
with
142 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package config_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestConfig(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Config Suite") | ||
} |
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,30 @@ | ||
package config_test | ||
|
||
import ( | ||
"github.com/guidewire/fern-reporter/config" | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("Config", func() { | ||
Context("LoadConfig", func() { | ||
It("should load the configuration from a file", func() { | ||
|
||
appConfig, err := config.LoadConfig() | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
Expect(appConfig.Server.Port).To(Equal(":8080")) | ||
Expect(appConfig.Db.Driver).To(Equal("postgres")) | ||
Expect(appConfig.Db.Host).To(Equal("localhost")) | ||
Expect(appConfig.Db.Port).To(Equal("5432")) | ||
Expect(appConfig.Db.Database).To(Equal("fern")) | ||
Expect(appConfig.Db.Username).To(Equal("fern")) | ||
Expect(appConfig.Db.Password).To(Equal("fern")) | ||
Expect(appConfig.Db.DetailLog).To(BeTrue()) | ||
Expect(appConfig.Db.MaxOpenConns).To(Equal(100)) | ||
Expect(appConfig.Db.MaxIdleConns).To(Equal(10)) | ||
}) | ||
|
||
}) | ||
|
||
}) |
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.