tests

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AzureStorageAccountVar    string = "AZURE_STORAGE_ACCOUNT"
	AzureStorageKeyVar        string = "AZURE_STORAGE_KEY"
	AzuriteBlobEndpointURLVar string = "AZURITE_BLOB_ENDPOINT_URL"

	AzuriteWellKnownKey             string = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
	AzuriteWellKnownAccount         string = "devstoreaccount1"
	AzuriteWellKnownBlobEndpointURL string = "http://127.0.0.1:10000/devstoreaccount1/"
	AzuriteResourceGroup            string = "azurite-emulator"
	AzuriteSubscription             string = "azurite-emulator"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IntegrationTestSuite

type IntegrationTestSuite struct {
	suite.Suite

	Env TestEnv
	// contains filtered or unexported fields
}

IntegrationTestSuite base for all tests It's an integration test because we don't require a specifically deployed instance, we rely on the availability of prod.

func (*IntegrationTestSuite) AfterTest

func (s *IntegrationTestSuite) AfterTest(suiteName, testName string)

AfterTest is run after the test has executed

Currently used to print useful information for failing tests

func (*IntegrationTestSuite) BeforeTest

func (s *IntegrationTestSuite) BeforeTest(suiteName, testName string)

BeforeTest is run before the test

It gets the correct suite wide test environment As well as makes a test specific test tenant

func (*IntegrationTestSuite) CaptureAndCloseStdout added in v0.2.0

func (s *IntegrationTestSuite) CaptureAndCloseStdout() string

func (*IntegrationTestSuite) EnsureAzuriteEnv added in v0.1.0

func (s *IntegrationTestSuite) EnsureAzuriteEnv()

EnsureAzuriteEnv ensures the environment variables for azurite are set But respects any that are already set

func (*IntegrationTestSuite) ReplaceStdin added in v0.2.0

func (s *IntegrationTestSuite) ReplaceStdin()

func (*IntegrationTestSuite) ReplaceStdout added in v0.2.0

func (s *IntegrationTestSuite) ReplaceStdout()

func (*IntegrationTestSuite) SetupSuite

func (s *IntegrationTestSuite) SetupSuite()

func (*IntegrationTestSuite) StdinWriteAndClose

func (s *IntegrationTestSuite) StdinWriteAndClose(b []byte) (int, error)

StdinWriteAndClose writes the provided bytes to std in and closes the write side of pipe It should be called to provided input for any test that read stdin. os.Stdin is set to the read side of the pipe in BeforeTest, and restored in AfterTest.

type TestEnv

type TestEnv struct {

	// FQDN of the deployment to test against
	FQDN              string
	VerifiableDataURL string

	AzuriteVerifiableDataURL string

	// azure blob storage variable
	MerklelogAccountName string
	MerklelogURL         string
	PublicTenantId       string
	SynsationTenantId    string
	MerkelogURLPrefix    string
	PublicKey            string

	UnknownTenantId string
}

func NewTestEnv

func NewTestEnv() (TestEnv, error)

NewTestEnv generates retrieves values from the environment.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL