fixing tests

dev
mzack 2024-03-13 02:44:45 +01:00
parent 4aff6d7189
commit cbda987288
5 changed files with 11 additions and 2 deletions

View File

@ -31,6 +31,7 @@ func setup() {
options := testutils.DefaultOptions
testutils.Init(options)
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
parser, _ = templates.New()
executerOpts = protocols.ExecutorOptions{
Output: testutils.NewMockOutputWriter(options.OmitTemplate),

View File

@ -15,8 +15,10 @@ func TestCache(t *testing.T) {
require.Nil(t, err, "invalid value for err")
require.Nil(t, data, "invalid value for data")
templates.Store("test", &Template{}, testErr)
item := &Template{}
templates.Store("test", item, testErr)
data, err = templates.Has("test")
require.Equal(t, testErr, err, "invalid value for err")
require.Equal(t, "data", data, "invalid value for data")
require.Equal(t, item, data, "invalid value for data")
}

View File

@ -37,6 +37,7 @@ func setup() {
options := testutils.DefaultOptions
testutils.Init(options)
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
parser, _ := templates.New()
executerOpts = protocols.ExecutorOptions{
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
@ -47,6 +48,7 @@ func setup() {
Browser: nil,
Catalog: disk.NewCatalog(config.DefaultConfig.TemplatesDirectory),
RateLimiter: ratelimit.New(context.Background(), uint(options.RateLimit), time.Second),
Parser: parser,
}
workflowLoader, err := parsers.NewLoader(&executerOpts)
if err != nil {

View File

@ -25,6 +25,7 @@ func setup() {
options := testutils.DefaultOptions
testutils.Init(options)
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
parser, _ := templates.New()
executerOpts = protocols.ExecutorOptions{
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
@ -35,6 +36,7 @@ func setup() {
Browser: nil,
Catalog: disk.NewCatalog(config.DefaultConfig.TemplatesDirectory),
RateLimiter: ratelimit.New(context.Background(), uint(options.RateLimit), time.Second),
Parser: parser,
}
workflowLoader, err := parsers.NewLoader(&executerOpts)
if err != nil {

View File

@ -25,6 +25,7 @@ func setup() {
options := testutils.DefaultOptions
testutils.Init(options)
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
parser, _ := templates.New()
executerOpts = protocols.ExecutorOptions{
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
@ -35,6 +36,7 @@ func setup() {
Browser: nil,
Catalog: disk.NewCatalog(config.DefaultConfig.TemplatesDirectory),
RateLimiter: ratelimit.New(context.Background(), uint(options.RateLimit), time.Second),
Parser: parser,
}
workflowLoader, err := parsers.NewLoader(&executerOpts)
if err != nil {