Integration tests conditionally pull

If images aren't present, pull them.
Also fixes the expected responses
This commit is contained in:
Daniel Hiltgen 2024-03-24 16:22:38 -07:00
parent acfa2b9422
commit 7b6cbc10ec
4 changed files with 70 additions and 10 deletions

View file

@ -40,16 +40,16 @@ var (
},
},
}
resp = [2]string{
"scattering",
"united states thanksgiving",
resp = [2][]string{
[]string{"sunlight"},
[]string{"england", "english", "massachusetts", "pilgrims"},
}
)
func TestIntegrationSimpleOrcaMini(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*60)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*120)
defer cancel()
GenerateTestHelper(ctx, t, &http.Client{}, req[0], []string{resp[0]})
GenerateTestHelper(ctx, t, &http.Client{}, req[0], resp[0])
}
// TODO
@ -59,12 +59,12 @@ func TestIntegrationSimpleOrcaMini(t *testing.T) {
func TestIntegrationConcurrentPredictOrcaMini(t *testing.T) {
var wg sync.WaitGroup
wg.Add(len(req))
ctx, cancel := context.WithTimeout(context.Background(), time.Second*60)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*120)
defer cancel()
for i := 0; i < len(req); i++ {
go func(i int) {
defer wg.Done()
GenerateTestHelper(ctx, t, &http.Client{}, req[i], []string{resp[i]})
GenerateTestHelper(ctx, t, &http.Client{}, req[i], resp[i])
}(i)
}
wg.Wait()