go: fix DoRandomSearch unit test
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
the test was previously failing due to a folder not present when results were to be saved.
This commit is contained in:
parent
b24f7db46f
commit
babbd4201e
@ -4,6 +4,7 @@
|
||||
package algo
|
||||
|
||||
import (
|
||||
"os"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
@ -11,13 +12,15 @@ import (
|
||||
var wg sync.WaitGroup
|
||||
|
||||
func TestDoRandomSearchExec(t *testing.T) {
|
||||
// TODO(me): figure out how to test this.
|
||||
wg.Add(1)
|
||||
|
||||
// wg.Add(1)
|
||||
go DoRandomSearch(&wg)
|
||||
|
||||
// go DoRandomSearch(&wg)
|
||||
wg.Wait()
|
||||
|
||||
// wg.Wait()
|
||||
if err := os.RemoveAll(picPath); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDoSHCExec(t *testing.T) {
|
||||
|
@ -59,6 +59,10 @@ func plotAllDims(allStats []stats.Stats, fPrefix, fExt string) {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if err := createFolder(picPath); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
|
||||
filename := picPath +
|
||||
fPrefix + "-" +
|
||||
sanitiseFName(s.Algo) + "-" +
|
||||
|
Loading…
Reference in New Issue
Block a user