mirror of
https://github.com/kataras/iris.git
synced 2025-03-14 08:16:28 +01:00
Fix travis test
On normal pc is running but travis slows things... so timing is not a good idea to test, if that fails again I will remove this test from github entirely.......
This commit is contained in:
parent
539c62f954
commit
606e824036
|
@ -57,7 +57,7 @@ All features of Sundown are supported, including:
|
||||||
// EXAMPLE: https://github.com/iris-contrib/examples/tree/master/cache_body
|
// EXAMPLE: https://github.com/iris-contrib/examples/tree/master/cache_body
|
||||||
func TestCacheCanRender(t *testing.T) {
|
func TestCacheCanRender(t *testing.T) {
|
||||||
iris.ResetDefault()
|
iris.ResetDefault()
|
||||||
iris.Config.CacheGCDuration = time.Duration(2) * time.Second
|
iris.Config.CacheGCDuration = time.Duration(10) * time.Second
|
||||||
iris.Config.IsDevelopment = true
|
iris.Config.IsDevelopment = true
|
||||||
defer iris.Close()
|
defer iris.Close()
|
||||||
var i = 1
|
var i = 1
|
||||||
|
@ -71,7 +71,7 @@ func TestCacheCanRender(t *testing.T) {
|
||||||
ctx.Markdown(iris.StatusOK, testMarkdownContents)
|
ctx.Markdown(iris.StatusOK, testMarkdownContents)
|
||||||
}
|
}
|
||||||
|
|
||||||
expiration := time.Duration(15 * time.Second)
|
expiration := time.Duration(1 * time.Minute)
|
||||||
|
|
||||||
iris.Get("/", iris.Cache(bodyHandler, expiration))
|
iris.Get("/", iris.Cache(bodyHandler, expiration))
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ func TestCacheCanRender(t *testing.T) {
|
||||||
expectedBody := iris.SerializeToString("text/markdown", testMarkdownContents)
|
expectedBody := iris.SerializeToString("text/markdown", testMarkdownContents)
|
||||||
|
|
||||||
e.GET("/").Expect().Status(iris.StatusOK).Body().Equal(expectedBody)
|
e.GET("/").Expect().Status(iris.StatusOK).Body().Equal(expectedBody)
|
||||||
e.GET("/").Expect().Status(iris.StatusOK).Body().Equal(expectedBody) // the 15 seconds didnt' passed so it should work
|
e.GET("/").Expect().Status(iris.StatusOK).Body().Equal(expectedBody) // the 1 minute didnt' passed so it should work
|
||||||
|
|
||||||
// travis... and time sleep not a good idea for testing, we will see what we can do other day, the cache is tested on examples too*
|
// travis... and time sleep not a good idea for testing, we will see what we can do other day, the cache is tested on examples too*
|
||||||
/*e.GET("/").Expect().Status(iris.StatusOK).Body().Equal(expectedBody) // the cache still son the corrrect body so no StatusNoContent fires
|
/*e.GET("/").Expect().Status(iris.StatusOK).Body().Equal(expectedBody) // the cache still son the corrrect body so no StatusNoContent fires
|
||||||
|
|
Loading…
Reference in New Issue
Block a user