-
Notifications
You must be signed in to change notification settings - Fork 2
/
integration_test.go
42 lines (34 loc) · 1.04 KB
/
integration_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//go:build integration
// +build integration
package nodeless
import (
"fmt"
"os"
"gopkg.in/yaml.v3"
)
// This file loads secrets used for integration tests
const integrationSecretsPath = "./integration.secrets"
var integrationSecrets struct {
APIKey string `yaml:"api_key"`
StoreID string `yaml:"store_id"`
StoreName string `yaml:"store_name"`
ExpiredInvoiceID string `yaml:"expired_invoice_id"`
PaidInvoiceID string `yaml:"paid_invoice_id"`
TransactionID string `yaml:"transaction_id"`
StoreWebhookID string `yaml:"store_webhook_id"`
PaywallID string `yaml:"paywall_id"`
PaywallWebhookID string `yaml:"paywall_webhook_id"`
PaywallRequestID string `yaml:"paywall_request_id"`
}
func init() {
f, err := os.Open(integrationSecretsPath)
if err != nil {
fmt.Printf("must create 'integration.secrets' file!")
os.Exit(1)
}
defer f.Close()
if err := yaml.NewDecoder(f).Decode(&integrationSecrets); err != nil {
fmt.Printf("failed to decode integrations.secrets file as yaml: %v", err)
os.Exit(1)
}
}