fixed tests - removed database creds from logs

pull/239/head
hunterlong 2019-09-03 14:10:13 -07:00
parent ce90d9d341
commit 50ba485fcd
17 changed files with 337 additions and 265 deletions

103
Gopkg.lock generated
View File

@ -2,8 +2,7 @@
[[projects]] [[projects]]
branch = "master" digest = "1:d4bfd57449b0bdfe927ec45c8463afd8f5b6012d4bcd5a9da8581a408c23e57c"
digest = "1:a2de8c02990ea7cb28b962d2effa6840cc2c849b298736eef57a9713432cc0d3"
name = "github.com/99designs/gqlgen" name = "github.com/99designs/gqlgen"
packages = [ packages = [
"complexity", "complexity",
@ -12,7 +11,8 @@
"handler", "handler",
] ]
pruneopts = "UT" pruneopts = "UT"
revision = "afe33f73875beca92e917742c1f49c1f6145018b" revision = "a7bc468ca1b184a5ce1b07ea331e0121fc56ae82"
version = "v0.9.3"
[[projects]] [[projects]]
digest = "1:07f7314344b2771963ada0b2a4a426c59d782dac227dcfff2499188a186446c0" digest = "1:07f7314344b2771963ada0b2a4a426c59d782dac227dcfff2499188a186446c0"
@ -42,12 +42,12 @@
version = "0.0.1" version = "0.0.1"
[[projects]] [[projects]]
digest = "1:86b9f9c54fcddec313009ef19073bf0124bbdae3701080c32f67c0c8817b3b7c" digest = "1:8e8da6cc8cca12851d4e089d970a0f7387b3a6bcc8c459ff432213b03076a66d"
name = "github.com/daaku/go.zipexe" name = "github.com/daaku/go.zipexe"
packages = ["."] packages = ["."]
pruneopts = "UT" pruneopts = "UT"
revision = "db7cf2ba330f8c2d28b827826e33d6628ea7e9e0" revision = "74d766ac1dde7458348221869a7d1e7e5fa0597e"
version = "v1.0.0" version = "v1.0.1"
[[projects]] [[projects]]
digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec"
@ -82,20 +82,12 @@
version = "v2.2.2" version = "v2.2.2"
[[projects]] [[projects]]
digest = "1:c79fb010be38a59d657c48c6ba1d003a8aa651fa56b579d959d74573b7dff8e1" digest = "1:cbec35fe4d5a4fba369a656a8cd65e244ea2c743007d8f6c1ccb132acf9d1296"
name = "github.com/gorilla/context"
packages = ["."]
pruneopts = "UT"
revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42"
version = "v1.1.1"
[[projects]]
digest = "1:d5f97fc268267ec1b61c3453058c738246fc3e746f14b1ae25161513b7367b0c"
name = "github.com/gorilla/mux" name = "github.com/gorilla/mux"
packages = ["."] packages = ["."]
pruneopts = "UT" pruneopts = "UT"
revision = "c5c6c98bc25355028a63748a498942a6398ccd22" revision = "00bdffe0f3c77e27d2cf6f5c70232a2d3e4d9c15"
version = "v1.7.1" version = "v1.7.3"
[[projects]] [[projects]]
digest = "1:e72d1ebb8d395cf9f346fd9cbc652e5ae222dd85e0ac842dc57f175abed6d195" digest = "1:e72d1ebb8d395cf9f346fd9cbc652e5ae222dd85e0ac842dc57f175abed6d195"
@ -106,34 +98,34 @@
version = "v1.1.1" version = "v1.1.1"
[[projects]] [[projects]]
digest = "1:e5bf52fd66a2e984b57b4c0f2c4ee024ed749a19886246240629998dc0cf31ce" digest = "1:172c862eabc72e90f461bcef223c49869628bec6d989386dfb03281ae3222148"
name = "github.com/gorilla/sessions" name = "github.com/gorilla/sessions"
packages = ["."] packages = ["."]
pruneopts = "UT" pruneopts = "UT"
revision = "f57b7e2d29c6211d16ffa52a0998272f75799030" revision = "4355a998706e83fe1d71c31b07af94e34f68d74a"
version = "v1.1.3" version = "v1.2.0"
[[projects]] [[projects]]
digest = "1:7b5c6e2eeaa9ae5907c391a91c132abfd5c9e8a784a341b5625e750c67e6825d" digest = "1:e62657cca9badaa308d86e7716083e4c5933bb78e30a17743fc67f50be26f6f4"
name = "github.com/gorilla/websocket" name = "github.com/gorilla/websocket"
packages = ["."] packages = ["."]
pruneopts = "UT" pruneopts = "UT"
revision = "66b9c49e59c6c48f0ffce28c2d8b8a5678502c6d" revision = "c3e18be99d19e6b3e8f1559eea2c161a665c4b6b"
version = "v1.4.0" version = "v1.4.1"
[[projects]] [[projects]]
digest = "1:d15ee511aa0f56baacc1eb4c6b922fa1c03b38413b6be18166b996d82a0156ea" digest = "1:c77361e611524ec8f2ad37c408c3c916111a70b6acf806a1200855696bf8fa4d"
name = "github.com/hashicorp/golang-lru" name = "github.com/hashicorp/golang-lru"
packages = [ packages = [
".", ".",
"simplelru", "simplelru",
] ]
pruneopts = "UT" pruneopts = "UT"
revision = "7087cb70de9f7a8bc0a10c375cb0d2280a8edf9c" revision = "7f827b33c0f158ec5dfbba01bb0b14a4541fd81d"
version = "v0.5.1" version = "v0.5.3"
[[projects]] [[projects]]
digest = "1:0731b955911f880c75409845b54203f5127c72e003691e2d34462a0516a9b1f6" digest = "1:b0c1770be8c52cf00117b98049de1e4df91c8df588102198364b09669bb60178"
name = "github.com/jinzhu/gorm" name = "github.com/jinzhu/gorm"
packages = [ packages = [
".", ".",
@ -142,16 +134,16 @@
"dialects/sqlite", "dialects/sqlite",
] ]
pruneopts = "UT" pruneopts = "UT"
revision = "e3987fd4b803c16497aa4dfd2e75db7a6a061a4e" revision = "836fb2c19d84dac7b0272958dfb9af7cf0d0ade4"
version = "v1.9.4" version = "v1.9.10"
[[projects]] [[projects]]
branch = "master" digest = "1:01ed62f8f4f574d8aff1d88caee113700a2b44c42351943fa73cc1808f736a50"
digest = "1:fd97437fbb6b7dce04132cf06775bd258cce305c44add58eb55ca86c6c325160"
name = "github.com/jinzhu/inflection" name = "github.com/jinzhu/inflection"
packages = ["."] packages = ["."]
pruneopts = "UT" pruneopts = "UT"
revision = "04140366298a54a039076d798123ffa108fff46c" revision = "f5c5f50e6090ae76a29240b61ae2a90dd810112e"
version = "v1.0.0"
[[projects]] [[projects]]
digest = "1:ecd9aa82687cf31d1585d4ac61d0ba180e42e8a6182b85bd785fcca8dfeefc1b" digest = "1:ecd9aa82687cf31d1585d4ac61d0ba180e42e8a6182b85bd785fcca8dfeefc1b"
@ -162,7 +154,7 @@
version = "v1.3.0" version = "v1.3.0"
[[projects]] [[projects]]
digest = "1:226be3582c304c347481157049c862924fdd6277256e854781c5ba4728901215" digest = "1:0ead8e64fe356bd9221605e3ec40b4438509868018cbbbaaaff3ebae1b69b78b"
name = "github.com/lib/pq" name = "github.com/lib/pq"
packages = [ packages = [
".", ".",
@ -171,16 +163,16 @@
"scram", "scram",
] ]
pruneopts = "UT" pruneopts = "UT"
revision = "51e2106eed1cea199c802d2a49e91e2491b02056" revision = "3427c32cb71afc948325f299f040e53c1dd78979"
version = "v1.1.0" version = "v1.2.0"
[[projects]] [[projects]]
digest = "1:4a49346ca45376a2bba679ca0e83bec949d780d4e927931317904bad482943ec" digest = "1:79e87abf06b873987dee86598950f5b51732ac454d5a5cab6445a14330e6c9e3"
name = "github.com/mattn/go-sqlite3" name = "github.com/mattn/go-sqlite3"
packages = ["."] packages = ["."]
pruneopts = "UT" pruneopts = "UT"
revision = "c7c4067b79cc51e6dfdcef5c702e74b1e0fa7c75" revision = "b612a2feea6aa87c6d052d9086572551df06497e"
version = "v1.10.0" version = "v1.11.0"
[[projects]] [[projects]]
digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe"
@ -207,12 +199,12 @@
version = "v1.0.0" version = "v1.0.0"
[[projects]] [[projects]]
digest = "1:972c2427413d41a1e06ca4897e8528e5a1622894050e2f527b38ddf0f343f759" digest = "1:8548c309c65a85933a625be5e7d52b6ac927ca30c56869fae58123b8a77a75e1"
name = "github.com/stretchr/testify" name = "github.com/stretchr/testify"
packages = ["assert"] packages = ["assert"]
pruneopts = "UT" pruneopts = "UT"
revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053" revision = "221dbe5ed46703ee255b1da0dec05086f5035f62"
version = "v1.3.0" version = "v1.4.0"
[[projects]] [[projects]]
branch = "master" branch = "master"
@ -247,11 +239,11 @@
"blowfish", "blowfish",
] ]
pruneopts = "UT" pruneopts = "UT"
revision = "a29dc8fdc73485234dbef99ebedb95d2eced08de" revision = "9756ffdc24725223350eb3266ffb92590d28f278"
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:5e22b2014e7cd102e2b41ab7dd38b9c5175e3447b653033987164bebc858e958" digest = "1:caffb9a4f8c756941de4b3eb577abd167e7fd4b570f2078c05ceb8835a1514cb"
name = "golang.org/x/net" name = "golang.org/x/net"
packages = [ packages = [
"bpf", "bpf",
@ -262,15 +254,26 @@
"ipv6", "ipv6",
] ]
pruneopts = "UT" pruneopts = "UT"
revision = "4829fb13d2c62012c17688fa7f629f371014946d" revision = "ba9fcec4b297b415637633c5a6e8fa592e4a16c3"
[[projects]]
branch = "master"
digest = "1:d94059c196c160bd1c4030d49ffaa39a456be516501e5916bea663f5d79a75ec"
name = "golang.org/x/sys"
packages = [
"unix",
"windows",
]
pruneopts = "UT"
revision = "9109b7679e13aa34a54834cfb4949cac4b96e576"
[[projects]] [[projects]]
digest = "1:c25289f43ac4a68d88b02245742347c94f1e108c534dda442188015ff80669b3" digest = "1:c25289f43ac4a68d88b02245742347c94f1e108c534dda442188015ff80669b3"
name = "google.golang.org/appengine" name = "google.golang.org/appengine"
packages = ["cloudsql"] packages = ["cloudsql"]
pruneopts = "UT" pruneopts = "UT"
revision = "54a98f90d1c46b7731eb8fb305d2a321c30ef610" revision = "5f2a59506353b8d5ba8cbbcd9f3c1f41f1eaf079"
version = "v1.5.0" version = "v1.6.2"
[[projects]] [[projects]]
branch = "v3" branch = "v3"
@ -296,6 +299,14 @@
revision = "d3b5b032dc8e8927d31a5071b56e14c89f045135" revision = "d3b5b032dc8e8927d31a5071b56e14c89f045135"
version = "v2.0.1" version = "v2.0.1"
[[projects]]
digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96"
name = "gopkg.in/yaml.v2"
packages = ["."]
pruneopts = "UT"
revision = "51d6538a90f86fe93ac480b35f37b2be17fef232"
version = "v2.2.2"
[solve-meta] [solve-meta]
analyzer-name = "dep" analyzer-name = "dep"
analyzer-version = 1 analyzer-version = 1

View File

@ -27,7 +27,7 @@
[[constraint]] [[constraint]]
name = "github.com/99designs/gqlgen" name = "github.com/99designs/gqlgen"
branch = "master" version = "0.9.3"
[[constraint]] [[constraint]]
name = "github.com/GeertJohan/go.rice" name = "github.com/GeertJohan/go.rice"
@ -47,15 +47,15 @@
[[constraint]] [[constraint]]
name = "github.com/gorilla/mux" name = "github.com/gorilla/mux"
version = "1.7.1" version = "1.7.3"
[[constraint]] [[constraint]]
name = "github.com/gorilla/sessions" name = "github.com/gorilla/sessions"
version = "1.1.3" version = "1.2.0"
[[constraint]] [[constraint]]
name = "github.com/jinzhu/gorm" name = "github.com/jinzhu/gorm"
version = "1.9.4" version = "1.9.10"
[[constraint]] [[constraint]]
name = "github.com/joho/godotenv" name = "github.com/joho/godotenv"
@ -67,7 +67,7 @@
[[constraint]] [[constraint]]
name = "github.com/stretchr/testify" name = "github.com/stretchr/testify"
version = "1.3.0" version = "1.4.0"
[[constraint]] [[constraint]]
branch = "master" branch = "master"

View File

@ -40,6 +40,7 @@ func checkServices() {
} }
// Check will run checkHttp for HTTP services and checkTcp for TCP services // Check will run checkHttp for HTTP services and checkTcp for TCP services
// if record param is set to true, it will add a record into the database.
func (s *Service) Check(record bool) { func (s *Service) Check(record bool) {
switch s.Type { switch s.Type {
case "http": case "http":
@ -260,8 +261,8 @@ func recordSuccess(s *Service) {
} }
utils.Log(1, fmt.Sprintf("Service %v Successful Response: %0.2f ms | Lookup in: %0.2f ms", s.Name, hit.Latency*1000, hit.PingTime*1000)) utils.Log(1, fmt.Sprintf("Service %v Successful Response: %0.2f ms | Lookup in: %0.2f ms", s.Name, hit.Latency*1000, hit.PingTime*1000))
s.CreateHit(hit) s.CreateHit(hit)
notifier.OnSuccess(s.Service)
s.Online = true s.Online = true
notifier.OnSuccess(s.Service)
} }
// recordFailure will create a new 'Failure' record in the database for a offline service // recordFailure will create a new 'Failure' record in the database for a offline service
@ -275,7 +276,6 @@ func recordFailure(s *Service, issue string) {
}} }}
utils.Log(2, fmt.Sprintf("Service %v Failing: %v | Lookup in: %0.2f ms", s.Name, issue, fail.PingTime*1000)) utils.Log(2, fmt.Sprintf("Service %v Failing: %v | Lookup in: %0.2f ms", s.Name, issue, fail.PingTime*1000))
s.CreateFailure(fail) s.CreateFailure(fail)
notifier.OnFailure(s.Service, fail.Failure)
s.Online = false s.Online = false
notifier.OnFailure(s.Service, fail.Failure)
} }

View File

@ -217,7 +217,7 @@ func (db *DbConfig) Connect(retry bool, location string) error {
dbSession, err := gorm.Open(dbType, conn) dbSession, err := gorm.Open(dbType, conn)
if err != nil { if err != nil {
if retry { if retry {
utils.Log(1, fmt.Sprintf("Database connection to '%v' is not available, trying again in 5 seconds...", conn)) utils.Log(1, fmt.Sprintf("Database connection to '%v' is not available, trying again in 5 seconds...", Configs.DbHost))
return db.waitForDb() return db.waitForDb()
} else { } else {
return err return err
@ -229,7 +229,7 @@ func (db *DbConfig) Connect(retry bool, location string) error {
err = dbSession.DB().Ping() err = dbSession.DB().Ping()
if err == nil { if err == nil {
DbSession = dbSession DbSession = dbSession
utils.Log(1, fmt.Sprintf("Database %v connection '%v@%v:%v' at %v was successful.", dbType, Configs.DbUser, Configs.DbHost, Configs.DbPort, Configs.DbData)) utils.Log(1, fmt.Sprintf("Database %v connection was successful.", dbType))
} }
return err return err
} }

View File

@ -64,18 +64,15 @@ func TestSelectTCPService(t *testing.T) {
func TestUpdateService(t *testing.T) { func TestUpdateService(t *testing.T) {
service := SelectService(1) service := SelectService(1)
service2 := SelectService(2)
assert.Equal(t, "Google", service.Name) assert.Equal(t, "Google", service.Name)
assert.Equal(t, "Statping Github", service2.Name)
assert.True(t, service.Online)
assert.True(t, service2.Online)
service.Name = "Updated Google" service.Name = "Updated Google"
service.Interval = 5 service.Interval = 5
err := service.Update(true) err := service.Update(true)
assert.Nil(t, err) assert.Nil(t, err)
// check if updating pointer array shutdown any other service // check if updating pointer array shutdown any other service
service2 = SelectService(2) service = SelectService(1)
assert.True(t, service2.Online) assert.Equal(t, "Updated Google", service.Name)
assert.Equal(t, 5, service.Interval)
} }
func TestUpdateAllServices(t *testing.T) { func TestUpdateAllServices(t *testing.T) {

View File

@ -66,33 +66,16 @@ func TestCommandNotifier(t *testing.T) {
assert.Equal(t, 1, len(command.Queue)) assert.Equal(t, 1, len(command.Queue))
}) })
t.Run("command OnFailure multiple times", func(t *testing.T) {
for i := 0; i <= 50; i++ {
command.OnFailure(TestService, TestFailure)
}
assert.Equal(t, 52, len(command.Queue))
})
t.Run("command Check Offline", func(t *testing.T) {
assert.False(t, TestService.Online)
})
t.Run("command OnSuccess", func(t *testing.T) { t.Run("command OnSuccess", func(t *testing.T) {
command.OnSuccess(TestService) command.OnSuccess(TestService)
assert.Equal(t, 1, len(command.Queue)) assert.Equal(t, 1, len(command.Queue))
}) })
t.Run("command Queue after being online", func(t *testing.T) {
assert.True(t, TestService.Online)
assert.Equal(t, 1, len(command.Queue))
})
t.Run("command OnSuccess Again", func(t *testing.T) { t.Run("command OnSuccess Again", func(t *testing.T) {
assert.True(t, TestService.Online)
command.OnSuccess(TestService) command.OnSuccess(TestService)
assert.Equal(t, 1, len(command.Queue)) assert.Equal(t, 1, len(command.Queue))
go notifier.Queue(command) go notifier.Queue(command)
time.Sleep(5 * time.Second) time.Sleep(20 * time.Second)
assert.Equal(t, 0, len(command.Queue)) assert.Equal(t, 0, len(command.Queue))
}) })

View File

@ -69,10 +69,6 @@ func TestDiscordNotifier(t *testing.T) {
assert.Equal(t, 1, len(discorder.Queue)) assert.Equal(t, 1, len(discorder.Queue))
}) })
t.Run("discord Check Offline", func(t *testing.T) {
assert.False(t, TestService.Online)
})
t.Run("discord OnSuccess", func(t *testing.T) { t.Run("discord OnSuccess", func(t *testing.T) {
discorder.OnSuccess(TestService) discorder.OnSuccess(TestService)
assert.Equal(t, 1, len(discorder.Queue)) assert.Equal(t, 1, len(discorder.Queue))

View File

@ -105,10 +105,6 @@ func TestEmailNotifier(t *testing.T) {
assert.Equal(t, 1, len(emailer.Queue)) assert.Equal(t, 1, len(emailer.Queue))
}) })
t.Run("email Check Offline", func(t *testing.T) {
assert.False(t, TestService.Online)
})
t.Run("email OnSuccess", func(t *testing.T) { t.Run("email OnSuccess", func(t *testing.T) {
emailer.OnSuccess(TestService) emailer.OnSuccess(TestService)
assert.Equal(t, 1, len(emailer.Queue)) assert.Equal(t, 1, len(emailer.Queue))

View File

@ -76,24 +76,15 @@ func TestMobileNotifier(t *testing.T) {
}) })
t.Run("mobile OnFailure multiple times", func(t *testing.T) { t.Run("mobile OnFailure multiple times", func(t *testing.T) {
for i := 0; i <= 50; i++ { for i := 0; i <= 5; i++ {
mobile.OnFailure(TestService, TestFailure) mobile.OnFailure(TestService, TestFailure)
} }
assert.Equal(t, 52, len(mobile.Queue)) assert.Equal(t, 7, len(mobile.Queue))
})
t.Run("mobile Check Offline", func(t *testing.T) {
assert.False(t, TestService.Online)
}) })
t.Run("mobile OnSuccess", func(t *testing.T) { t.Run("mobile OnSuccess", func(t *testing.T) {
mobile.OnSuccess(TestService) mobile.OnSuccess(TestService)
assert.Equal(t, 1, len(mobile.Queue)) assert.Equal(t, 7, len(mobile.Queue))
})
t.Run("mobile Queue after being online", func(t *testing.T) {
assert.True(t, TestService.Online)
assert.Equal(t, 1, len(mobile.Queue))
}) })
t.Run("mobile OnSuccess Again", func(t *testing.T) { t.Run("mobile OnSuccess Again", func(t *testing.T) {

View File

@ -42,6 +42,7 @@ var TestService = &types.Service{
Method: "GET", Method: "GET",
Timeout: 20, Timeout: 20,
LastStatusCode: 404, LastStatusCode: 404,
Online: true,
LastResponse: "<html>this is an example response</html>", LastResponse: "<html>this is an example response</html>",
CreatedAt: time.Now().Add(-24 * time.Hour), CreatedAt: time.Now().Add(-24 * time.Hour),
} }

View File

@ -78,33 +78,17 @@ func TestSlackNotifier(t *testing.T) {
assert.Equal(t, 1, len(slacker.Queue)) assert.Equal(t, 1, len(slacker.Queue))
}) })
t.Run("slack OnFailure multiple times", func(t *testing.T) {
for i := 0; i <= 50; i++ {
slacker.OnFailure(TestService, TestFailure)
}
assert.Equal(t, 52, len(slacker.Queue))
})
t.Run("slack Check Offline", func(t *testing.T) {
assert.False(t, TestService.Online)
})
t.Run("slack OnSuccess", func(t *testing.T) { t.Run("slack OnSuccess", func(t *testing.T) {
slacker.OnSuccess(TestService) slacker.OnSuccess(TestService)
assert.Equal(t, 1, len(slacker.Queue)) assert.Equal(t, 1, len(slacker.Queue))
}) })
t.Run("slack Queue after being online", func(t *testing.T) {
assert.True(t, TestService.Online)
assert.Equal(t, 1, len(slacker.Queue))
})
t.Run("slack OnSuccess Again", func(t *testing.T) { t.Run("slack OnSuccess Again", func(t *testing.T) {
assert.True(t, TestService.Online) assert.True(t, TestService.Online)
slacker.OnSuccess(TestService) slacker.OnSuccess(TestService)
assert.Equal(t, 1, len(slacker.Queue)) assert.Equal(t, 1, len(slacker.Queue))
go notifier.Queue(slacker) go notifier.Queue(slacker)
time.Sleep(6 * time.Second) time.Sleep(15 * time.Second)
assert.Equal(t, 0, len(slacker.Queue)) assert.Equal(t, 0, len(slacker.Queue))
}) })
@ -127,7 +111,7 @@ func TestSlackNotifier(t *testing.T) {
t.Run("slack Queue", func(t *testing.T) { t.Run("slack Queue", func(t *testing.T) {
go notifier.Queue(slacker) go notifier.Queue(slacker)
time.Sleep(5 * time.Second) time.Sleep(10 * time.Second)
assert.Equal(t, SLACK_URL, slacker.Host) assert.Equal(t, SLACK_URL, slacker.Host)
assert.Equal(t, 0, len(slacker.Queue)) assert.Equal(t, 0, len(slacker.Queue))
}) })

View File

@ -45,7 +45,6 @@ func init() {
func TestTwilioNotifier(t *testing.T) { func TestTwilioNotifier(t *testing.T) {
t.SkipNow() t.SkipNow()
t.Parallel()
if TWILIO_SID == "" || TWILIO_SECRET == "" || TWILIO_FROM == "" { if TWILIO_SID == "" || TWILIO_SECRET == "" || TWILIO_FROM == "" {
t.Log("twilio notifier testing skipped, missing TWILIO_SID environment variable") t.Log("twilio notifier testing skipped, missing TWILIO_SID environment variable")
t.SkipNow() t.SkipNow()

View File

@ -65,7 +65,7 @@ func TestWebhookNotifier(t *testing.T) {
t.Run("webhooker Replace Body Text", func(t *testing.T) { t.Run("webhooker Replace Body Text", func(t *testing.T) {
fullMsg = replaceBodyText(webhookMessage, TestService, TestFailure) fullMsg = replaceBodyText(webhookMessage, TestService, TestFailure)
assert.Equal(t, `{"id": "1","name": "Interpol - All The Rage Back Home","online": "false","issue": "testing"}`, fullMsg) assert.Equal(t, `{"id": "1","name": "Interpol - All The Rage Back Home","online": "true","issue": "testing"}`, fullMsg)
}) })
t.Run("webhooker Within Limits", func(t *testing.T) { t.Run("webhooker Within Limits", func(t *testing.T) {
@ -79,10 +79,6 @@ func TestWebhookNotifier(t *testing.T) {
assert.Len(t, webhook.Queue, 1) assert.Len(t, webhook.Queue, 1)
}) })
t.Run("webhooker Check Offline", func(t *testing.T) {
assert.False(t, TestService.Online)
})
t.Run("webhooker OnSuccess", func(t *testing.T) { t.Run("webhooker OnSuccess", func(t *testing.T) {
webhook.OnSuccess(TestService) webhook.OnSuccess(TestService)
assert.Equal(t, len(webhook.Queue), 1) assert.Equal(t, len(webhook.Queue), 1)

View File

@ -7,54 +7,66 @@
/* Mobile Service Container */ /* Mobile Service Container */
HTML, BODY { HTML, BODY {
background-color: #fcfcfc; background-color: #fcfcfc;
padding-bottom: 10px; } padding-bottom: 10px;
}
.container { .container {
padding-top: 20px; padding-top: 20px;
padding-bottom: 25px; padding-bottom: 25px;
max-width: 860px; max-width: 860px;
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; } box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}
.header-title { .header-title {
color: #464646; } color: #464646;
}
.header-desc { .header-desc {
color: #939393; } color: #939393;
}
.btn { .btn {
border-radius: 0.2rem; } border-radius: 0.2rem;
}
.online_list .badge { .online_list .badge {
margin-top: 0.2rem; } margin-top: 0.2rem;
}
.navbar { .navbar {
margin-bottom: 30px; } margin-bottom: 30px;
}
.btn-sm { .btn-sm {
line-height: 1.3; line-height: 1.3;
font-size: 0.75rem; } font-size: 0.75rem;
}
.view_service_btn { .view_service_btn {
position: absolute; position: absolute;
bottom: -40px; bottom: -40px;
right: 40px; } right: 40px;
}
.service_lower_info { .service_lower_info {
position: absolute; position: absolute;
bottom: -40px; bottom: -40px;
left: 40px; left: 40px;
color: #d1ffca; color: #d1ffca;
font-size: 0.85rem; } font-size: 0.85rem;
}
.lg_number { .lg_number {
font-size: 2.3rem; font-size: 2.3rem;
font-weight: bold; font-weight: bold;
display: block; display: block;
color: #4f4f4f; } color: #4f4f4f;
}
.stats_area { .stats_area {
text-align: center; text-align: center;
color: #a5a5a5; } color: #a5a5a5;
}
.lower_canvas { .lower_canvas {
height: 3.4rem; height: 3.4rem;
@ -62,82 +74,101 @@ HTML, BODY {
background-color: #48d338; background-color: #48d338;
padding: 15px 10px; padding: 15px 10px;
margin-left: 0px !important; margin-left: 0px !important;
margin-right: 0px !important; } margin-right: 0px !important;
}
.lower_canvas SPAN { .lower_canvas SPAN {
font-size: 1rem; font-size: 1rem;
color: #fff; } color: #fff;
}
.footer { .footer {
text-decoration: none; text-decoration: none;
margin-top: 20px; } margin-top: 20px;
}
.footer A { .footer A {
color: #8d8d8d; color: #8d8d8d;
text-decoration: none; } text-decoration: none;
}
.footer A:HOVER { .footer A:HOVER {
color: #6d6d6d; } color: #6d6d6d;
}
.badge { .badge {
color: white; color: white;
border-radius: 0.2rem; } border-radius: 0.2rem;
}
.btn-group { .btn-group {
height: 25px; } height: 25px;
}
.btn-group A { .btn-group A {
padding: 0.1rem .75rem; padding: 0.1rem 0.75rem;
font-size: 0.8rem; } font-size: 0.8rem;
}
.card-body .badge { .card-body .badge {
color: #fff; } color: #fff;
}
.nav-pills .nav-link { .nav-pills .nav-link {
border-radius: 0.2rem; } border-radius: 0.2rem;
}
.form-control { .form-control {
border-radius: 0.2rem; } border-radius: 0.2rem;
}
.card { .card {
background-color: #ffffff; background-color: #ffffff;
border: 1px solid rgba(0, 0, 0, 0.125); } border: 1px solid rgba(0, 0, 0, 0.125);
}
.card-body { .card-body {
overflow: hidden; } overflow: hidden;
}
.card-body H4 A { .card-body H4 A {
color: #444444; color: #444444;
text-decoration: none; } text-decoration: none;
}
.chart-container { .chart-container {
position: relative; position: relative;
height: 170px; height: 170px;
width: 100%; width: 100%;
overflow: hidden; } overflow: hidden;
}
.service-chart-container { .service-chart-container {
position: relative; position: relative;
height: 400px; height: 400px;
width: 100%; } width: 100%;
}
.service-chart-heatmap { .service-chart-heatmap {
position: relative; position: relative;
height: 300px; height: 300px;
width: 100%; } width: 100%;
}
.inputTags-field { .inputTags-field {
border: 0; border: 0;
background-color: transparent; background-color: transparent;
padding-top: .13rem; } padding-top: 0.13rem;
}
input.inputTags-field:focus { input.inputTags-field:focus {
outline-width: 0; } outline-width: 0;
}
.inputTags-list { .inputTags-list {
display: block; display: block;
width: 100%; width: 100%;
min-height: calc(2.25rem + 2px); min-height: calc(2.25rem + 2px);
padding: .2rem .35rem; padding: 0.2rem 0.35rem;
font-size: 1rem; font-size: 1rem;
font-weight: 400; font-weight: 400;
line-height: 1.5; line-height: 1.5;
@ -145,8 +176,9 @@ input.inputTags-field:focus {
background-color: #fff; background-color: #fff;
background-clip: padding-box; background-clip: padding-box;
border: 1px solid #ced4da; border: 1px solid #ced4da;
border-radius: .25rem; border-radius: 0.25rem;
transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out; } transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.inputTags-item { .inputTags-item {
background-color: #3aba39; background-color: #3aba39;
@ -154,63 +186,81 @@ input.inputTags-field:focus {
padding: 5px 8px; padding: 5px 8px;
font-size: 10pt; font-size: 10pt;
color: white; color: white;
border-radius: 4px; } border-radius: 4px;
}
.inputTags-item .close-item { .inputTags-item .close-item {
margin-left: 6px; margin-left: 6px;
font-size: 13pt; font-size: 13pt;
font-weight: bold; font-weight: bold;
cursor: pointer; } cursor: pointer;
}
.btn-primary { .btn-primary {
background-color: #3e9bff; background-color: #3e9bff;
border-color: #006fe6; border-color: #006fe6;
color: white; } color: white;
}
.btn-primary.dyn-dark { .btn-primary.dyn-dark {
background-color: #32a825 !important; background-color: #32a825 !important;
border-color: #2c9320 !important; } border-color: #2c9320 !important;
}
.btn-primary.dyn-light { .btn-primary.dyn-light {
background-color: #75de69 !important; background-color: #75de69 !important;
border-color: #88e37e !important; } border-color: #88e37e !important;
}
.btn-success { .btn-success {
background-color: #47d337; } background-color: #47d337;
}
.btn-success.dyn-dark { .btn-success.dyn-dark {
background-color: #32a825 !important; background-color: #32a825 !important;
border-color: #2c9320 !important; } border-color: #2c9320 !important;
}
.btn-success.dyn-light { .btn-success.dyn-light {
background-color: #75de69 !important; background-color: #75de69 !important;
border-color: #88e37e !important; } border-color: #88e37e !important;
}
.btn-danger { .btn-danger {
background-color: #dd3545; } background-color: #dd3545;
}
.btn-danger.dyn-dark { .btn-danger.dyn-dark {
background-color: #b61f2d !important; background-color: #b61f2d !important;
border-color: #a01b28 !important; } border-color: #a01b28 !important;
}
.btn-danger.dyn-light { .btn-danger.dyn-light {
background-color: #e66975 !important; background-color: #e66975 !important;
border-color: #e97f89 !important; } border-color: #e97f89 !important;
}
.bg-success { .bg-success {
background-color: #47d337 !important; } background-color: #47d337 !important;
}
.bg-danger { .bg-danger {
background-color: #dd3545 !important; } background-color: #dd3545 !important;
}
.bg-success .dyn-dark { .bg-success .dyn-dark {
background-color: #35b027 !important; } background-color: #35b027 !important;
}
.bg-danger .dyn-dark { .bg-danger .dyn-dark {
background-color: #bf202f !important; } background-color: #bf202f !important;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { .nav-pills .nav-link.active, .nav-pills .show > .nav-link {
background-color: #13a00d; } background-color: #13a00d;
}
.nav-pills A { .nav-pills A {
color: #424242; } color: #424242;
}
.nav-pills I { .nav-pills I {
margin-right: 10px; } margin-right: 10px;
}
.CodeMirror { .CodeMirror {
/* Bootstrap Settings */ /* Bootstrap Settings */
@ -230,23 +280,26 @@ input.inputTags-field:focus {
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 4px; border-radius: 4px;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
/* Code Mirror Settings */ /* Code Mirror Settings */
font-family: monospace; font-family: monospace;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
height: 80vh; } height: 80vh;
}
.CodeMirror-focused { .CodeMirror-focused {
/* Bootstrap Settings */ /* Bootstrap Settings */
border-color: #66afe9; border-color: #66afe9;
outline: 0; outline: 0;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
.switch { .switch {
font-size: 1rem; font-size: 1rem;
position: relative; } position: relative;
}
.switch input { .switch input {
position: absolute; position: absolute;
@ -257,7 +310,8 @@ input.inputTags-field:focus {
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
clip-path: inset(50%); clip-path: inset(50%);
overflow: hidden; overflow: hidden;
padding: 0; } padding: 0;
}
.switch input + label { .switch input + label {
position: relative; position: relative;
@ -270,23 +324,26 @@ input.inputTags-field:focus {
outline: none; outline: none;
user-select: none; user-select: none;
vertical-align: middle; vertical-align: middle;
text-indent: calc(calc(calc(2.375rem * .8) * 2) + .5rem); } text-indent: calc(calc(calc(2.375rem * .8) * 2) + .5rem);
}
.switch input + label::before, .switch input + label::before,
.switch input + label::after { .switch input + label::after {
content: ''; content: "";
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: calc(calc(2.375rem * .8) * 2); width: calc(calc(2.375rem * .8) * 2);
bottom: 0; bottom: 0;
display: block; } display: block;
}
.switch input + label::before { .switch input + label::before {
right: 0; right: 0;
background-color: #dee2e6; background-color: #dee2e6;
border-radius: calc(2.375rem * .8); border-radius: calc(2.375rem * .8);
transition: 0.2s all; } transition: 0.2s all;
}
.switch input + label::after { .switch input + label::after {
top: 2px; top: 2px;
@ -295,105 +352,137 @@ input.inputTags-field:focus {
height: calc(calc(2.375rem * .8) - calc(2px * 2)); height: calc(calc(2.375rem * .8) - calc(2px * 2));
border-radius: 50%; border-radius: 50%;
background-color: white; background-color: white;
transition: 0.2s all; } transition: 0.2s all;
}
.switch input:checked + label::before { .switch input:checked + label::before {
background-color: #08d; } background-color: #08d;
}
.switch input:checked + label::after { .switch input:checked + label::after {
margin-left: calc(2.375rem * .8); } margin-left: calc(2.375rem * .8);
}
.switch input:focus + label::before { .switch input:focus + label::before {
outline: none; outline: none;
box-shadow: 0 0 0 0.2rem rgba(0, 136, 221, 0.25); } box-shadow: 0 0 0 0.2rem rgba(0, 136, 221, 0.25);
}
.switch input:disabled + label { .switch input:disabled + label {
color: #868e96; color: #868e96;
cursor: not-allowed; } cursor: not-allowed;
}
.switch input:disabled + label::before { .switch input:disabled + label::before {
background-color: #e9ecef; } background-color: #e9ecef;
}
.switch.switch-sm { .switch.switch-sm {
font-size: 0.875rem; } font-size: 0.875rem;
}
.switch.switch-sm input + label { .switch.switch-sm input + label {
min-width: calc(calc(1.9375rem * .8) * 2); min-width: calc(calc(1.9375rem * .8) * 2);
height: calc(1.9375rem * .8); height: calc(1.9375rem * .8);
line-height: calc(1.9375rem * .8); line-height: calc(1.9375rem * .8);
text-indent: calc(calc(calc(1.9375rem * .8) * 2) + .5rem); } text-indent: calc(calc(calc(1.9375rem * .8) * 2) + .5rem);
}
.switch.switch-sm input + label::before { .switch.switch-sm input + label::before {
width: calc(calc(1.9375rem * .8) * 2); } width: calc(calc(1.9375rem * .8) * 2);
}
.switch.switch-sm input + label::after { .switch.switch-sm input + label::after {
width: calc(calc(1.9375rem * .8) - calc(2px * 2)); width: calc(calc(1.9375rem * .8) - calc(2px * 2));
height: calc(calc(1.9375rem * .8) - calc(2px * 2)); } height: calc(calc(1.9375rem * .8) - calc(2px * 2));
}
.switch.switch-sm input:checked + label::after { .switch.switch-sm input:checked + label::after {
margin-left: calc(1.9375rem * .8); } margin-left: calc(1.9375rem * .8);
}
.switch.switch-lg { .switch.switch-lg {
font-size: 1.25rem; } font-size: 1.25rem;
}
.switch.switch-lg input + label { .switch.switch-lg input + label {
min-width: calc(calc(3rem * .8) * 2); min-width: calc(calc(3rem * .8) * 2);
height: calc(3rem * .8); height: calc(3rem * .8);
line-height: calc(3rem * .8); line-height: calc(3rem * .8);
text-indent: calc(calc(calc(3rem * .8) * 2) + .5rem); } text-indent: calc(calc(calc(3rem * .8) * 2) + .5rem);
}
.switch.switch-lg input + label::before { .switch.switch-lg input + label::before {
width: calc(calc(3rem * .8) * 2); } width: calc(calc(3rem * .8) * 2);
}
.switch.switch-lg input + label::after { .switch.switch-lg input + label::after {
width: calc(calc(3rem * .8) - calc(2px * 2)); width: calc(calc(3rem * .8) - calc(2px * 2));
height: calc(calc(3rem * .8) - calc(2px * 2)); } height: calc(calc(3rem * .8) - calc(2px * 2));
}
.switch.switch-lg input:checked + label::after { .switch.switch-lg input:checked + label::after {
margin-left: calc(3rem * .8); } margin-left: calc(3rem * .8);
}
.switch + .switch { .switch + .switch {
margin-left: 1rem; } margin-left: 1rem;
}
@keyframes pulse_animation { @keyframes pulse_animation {
0% { 0% {
transform: scale(1); } transform: scale(1);
}
30% { 30% {
transform: scale(1); } transform: scale(1);
}
40% { 40% {
transform: scale(1.02); } transform: scale(1.02);
}
50% { 50% {
transform: scale(1); } transform: scale(1);
}
60% { 60% {
transform: scale(1); } transform: scale(1);
}
70% { 70% {
transform: scale(1.05); } transform: scale(1.05);
}
80% { 80% {
transform: scale(1); } transform: scale(1);
}
100% { 100% {
transform: scale(1); } } transform: scale(1);
}
}
.pulse { .pulse {
animation-name: pulse_animation; animation-name: pulse_animation;
animation-duration: 1500ms; animation-duration: 1500ms;
transform-origin: 70% 70%; transform-origin: 70% 70%;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-timing-function: linear; } animation-timing-function: linear;
}
@keyframes glow-grow { @keyframes glow-grow {
0% { 0% {
opacity: 0; opacity: 0;
transform: scale(1); } transform: scale(1);
}
80% { 80% {
opacity: 1; } opacity: 1;
}
100% { 100% {
transform: scale(2); transform: scale(2);
opacity: 0; } } opacity: 0;
}
}
.pulse-glow { .pulse-glow {
animation-name: glow-grown; animation-name: glow-grown;
animation-duration: 100ms; animation-duration: 100ms;
transform-origin: 70% 30%; transform-origin: 70% 30%;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-timing-function: linear; } animation-timing-function: linear;
}
.pulse-glow:before, .pulse-glow:before,
.pulse-glow:after { .pulse-glow:after {
@ -405,10 +494,12 @@ input.inputTags-field:focus {
right: 2.15rem; right: 2.15rem;
border-radius: 0; border-radius: 0;
box-shadow: 0 0 6px #47d337; box-shadow: 0 0 6px #47d337;
animation: glow-grow 2s ease-out infinite; } animation: glow-grow 2s ease-out infinite;
}
.sortable_drag { .sortable_drag {
background-color: #0000000f; } background-color: #0000000f;
}
.drag_icon { .drag_icon {
cursor: move; cursor: move;
@ -422,112 +513,139 @@ input.inputTags-field:focus {
margin-right: 5px; margin-right: 5px;
margin-left: -10px; margin-left: -10px;
text-align: center; text-align: center;
color: #b1b1b1; } color: #b1b1b1;
}
/* (Optional) Apply a "closed-hand" cursor during drag operation. */ /* (Optional) Apply a "closed-hand" cursor during drag operation. */
.drag_icon:active { .drag_icon:active {
cursor: grabbing; cursor: grabbing;
cursor: -moz-grabbing; cursor: -moz-grabbing;
cursor: -webkit-grabbing; } cursor: -webkit-grabbing;
}
.switch_btn { .switch_btn {
float: right; float: right;
margin: -1px 0px 0px 0px; margin: -1px 0px 0px 0px;
display: block; } display: block;
}
#start_container { #start_container {
position: absolute; position: absolute;
z-index: 99999; z-index: 99999;
margin-top: 20px; } margin-top: 20px;
}
#end_container { #end_container {
position: absolute; position: absolute;
z-index: 99999; z-index: 99999;
margin-top: 20px; margin-top: 20px;
right: 0; } right: 0;
}
.pointer { .pointer {
cursor: pointer; } cursor: pointer;
}
.jumbotron { .jumbotron {
background-color: white; } background-color: white;
}
.toggle-service { .toggle-service {
font-size: 18pt; font-size: 18pt;
float: left; float: left;
margin: 2px 3px 0 0; margin: 2px 3px 0 0;
cursor: pointer; } cursor: pointer;
}
@media (max-width: 767px) { @media (max-width: 767px) {
HTML, BODY { HTML, BODY {
background-color: #fcfcfc; } background-color: #fcfcfc;
}
.sm-container { .sm-container {
margin-top: 0px !important; margin-top: 0px !important;
padding: 0 !important; } padding: 0 !important;
}
.list-group-item H5 { .list-group-item H5 {
font-size: 0.9rem; } font-size: 0.9rem;
}
.container { .container {
padding: 0px !important; padding: 0px !important;
padding-top: 15px !important; } padding-top: 15px !important;
}
.group_header { .group_header {
margin-left: 15px; } margin-left: 15px;
}
.navbar { .navbar {
margin-left: 0px; margin-left: 0px;
margin-top: 0px; margin-top: 0px;
width: 100%; width: 100%;
margin-bottom: 0; } margin-bottom: 0;
}
.btn-sm { .btn-sm {
line-height: 0.9rem; line-height: 0.9rem;
font-size: 0.65rem; } font-size: 0.65rem;
}
.full-col-12 { .full-col-12 {
padding-left: 0px; padding-left: 0px;
padding-right: 0px; } padding-right: 0px;
}
.card { .card {
border: 0; border: 0;
border-radius: 0rem; border-radius: 0rem;
padding: 0; padding: 0;
background-color: #ffffff; } background-color: #ffffff;
}
.card-body { .card-body {
font-size: 10pt; font-size: 10pt;
padding: 0px 10px; } padding: 0px 10px;
}
.lg_number { .lg_number {
font-size: 7.8vw; } font-size: 7.8vw;
}
.stats_area { .stats_area {
margin-top: 1.5rem !important; margin-top: 1.5rem !important;
margin-bottom: 1.5rem !important; } margin-bottom: 1.5rem !important;
}
.stats_area .col-4 { .stats_area .col-4 {
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
font-size: 0.6rem; } font-size: 0.6rem;
}
.list-group-item { .list-group-item {
border-top: 1px solid #e4e4e4; border-top: 1px solid #e4e4e4;
border: 0px; } border: 0px;
}
.list-group-item:first-child { .list-group-item:first-child {
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; } border-top-right-radius: 0;
}
.list-group-item:last-child { .list-group-item:last-child {
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-bottom-left-radius: 0; } border-bottom-left-radius: 0;
}
.list-group-item P { .list-group-item P {
font-size: 0.7rem; } font-size: 0.7rem;
}
.service-chart-container { .service-chart-container {
height: 200px; } } height: 200px;
}
}
/*# sourceMappingURL=base.css.map */ /*# sourceMappingURL=base.css.map */

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
0.80.62 0.80.63