github.com/replit/upm@v0.0.0-20240423230255-9ce4fc3ea24c/test-suite/Main_test.go (about)

     1  package testSuite
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  	"os"
     7  	"strings"
     8  
     9  	"github.com/replit/upm/internal/backends"
    10  	"github.com/replit/upm/test-suite/templates"
    11  	testUtils "github.com/replit/upm/test-suite/utils"
    12  )
    13  
    14  var languageBackends []testUtils.BackendT
    15  
    16  var standardTemplates = []string{
    17  	"no-deps",
    18  	"one-dep",
    19  	"many-deps",
    20  }
    21  
    22  func init() {
    23  	backends.SetupAll()
    24  
    25  	fmt.Println("Preparing test suites:")
    26  	for _, bn := range backends.GetBackendNames() {
    27  		prefix := os.Getenv("UPM_SUITE_PREFIX")
    28  		if !strings.HasPrefix(bn.Name, prefix) {
    29  			continue
    30  		}
    31  		fmt.Println("- " + bn.Name)
    32  		bt := testUtils.InitBackendT(backends.GetBackend(context.Background(), bn.Name), &templates.FS)
    33  		languageBackends = append(languageBackends, bt)
    34  	}
    35  	fmt.Println()
    36  }