Skip to content

Commit

Permalink
Added tests for toolsPrintresults
Browse files Browse the repository at this point in the history
  • Loading branch information
mrLSD committed Feb 10, 2017
1 parent 6c58868 commit 11fc1bd
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/main.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ path = "/home/evgeny/gb/apps/iron.sh"
url = "http://localhost:3000/"

[[app]]
title = "Nimel pure & minimal"
title = "Nickel pure & minimal"
path = "/home/evgeny/gb/apps/nickel.sh"
url = "http://localhost:3000/"
11 changes: 11 additions & 0 deletions tools/ab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,15 @@ func TestAbCalculate(t *testing.T) {
if result[0].Ab.TimePerRequestAll.Quantor != "sec|min" {
t.Fatalf("Error calculation: %#v", "TimePerRequestAll.Quantor")
}

config := &cfg.Config{
App: []cfg.AppConfig{
{
Title: "Test 1",
Path: "/bin/bash",
Url: "test",
},
},
}
PrintResults(&result, config)
}
11 changes: 11 additions & 0 deletions tools/siege_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,15 @@ func TestSiegeCalculate(t *testing.T) {
if int(result[0].Siege.TransactionRate) != 1400 {
t.Fatalf("Error calculation: %v", "Siege.TransactionRate")
}

config := &cfg.Config{
App: []cfg.AppConfig{
{
Title: "Test 1",
Path: "/bin/bash",
Url: "test",
},
},
}
PrintResults(&result, config)
}
15 changes: 0 additions & 15 deletions tools/tools_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
package tools

/*
import (
"testing"
)
// TestDataAnalyze - invoke analyzer for fetching results
func TestCalculate(t *testing.T) {
data := BenchResults{}
data.Ab = AbResults{}
data.Wrk = WrkResults{}
data.Siege = SiegeResults{}
_ = data.Calculate(&data)
}
*/
11 changes: 11 additions & 0 deletions tools/wrk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,15 @@ func TestWrkCalculate(t *testing.T) {
if result[0].Wrk.LatencyDistribution99pers.Quantor != "us" {
t.Fatalf("Error calculation: %v", "Wrk.LatencyDistribution99pers.Quantor")
}

config := &cfg.Config{
App: []cfg.AppConfig{
{
Title: "Test 1",
Path: "/bin/bash",
Url: "test",
},
},
}
PrintResults(&result, config)
}

0 comments on commit 11fc1bd

Please sign in to comment.