2020-11-24 19:12:52 +00:00
package e2e
import (
"flag"
"testing"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var (
2020-12-10 00:26:05 +00:00
veleroCLI , veleroImage , cloudCredentialsFile , bslConfig , bslBucket , bslPrefix , vslConfig , pluginProvider string
2020-11-24 19:12:52 +00:00
)
func init ( ) {
2020-12-10 00:26:05 +00:00
flag . StringVar ( & pluginProvider , "plugin-provider" , "" , "Provider of object store and volume snapshotter plugins. Required." )
flag . StringVar ( & bslBucket , "bucket" , "" , "name of the object storage bucket where backups from e2e tests should be stored. Required." )
flag . StringVar ( & cloudCredentialsFile , "credentials-file" , "" , "file containing credentials for backup and volume provider. Required." )
flag . StringVar ( & veleroCLI , "velerocli" , "velero" , "path to the velero application to use." )
flag . StringVar ( & veleroImage , "velero-image" , "velero/velero:main" , "image for the velero server to be tested." )
flag . StringVar ( & bslConfig , "bsl-config" , "" , "configuration to use for the backup storage location. Format is key1=value1,key2=value2" )
flag . StringVar ( & bslPrefix , "prefix" , "" , "prefix under which all Velero data should be stored within the bucket. Optional." )
flag . StringVar ( & vslConfig , "vsl-config" , "" , "configuration to use for the volume snapshot location. Format is key1=value1,key2=value2" )
2020-11-24 19:12:52 +00:00
}
func TestE2e ( t * testing . T ) {
2020-12-10 00:26:05 +00:00
// Skip running E2E tests when running only "short" tests because:
// 1. E2E tests are long running tests involving installation of Velero and performing backup and restore operations.
// 2. E2E tests require a kubernetes cluster to install and run velero which further requires ore configuration. See above referenced command line flags.
if testing . Short ( ) {
t . Skip ( "Skipping E2E tests" )
}
2020-11-24 19:12:52 +00:00
RegisterFailHandler ( Fail )
RunSpecs ( t , "E2e Suite" )
}