e2e

package
v1.0.99 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Note, this url should be accessible by Cycloid API
	CyTestCatalogRepoURL    = "git@github.com:cycloidio/cycloid-cli-test-catalog.git"
	CyTestCatalogRepoBranch = "master"
	CyTestConfigRepo        = "cycloid-template-catalog-config"
	TestAPIURL              = "https://api-cli-test.staging.cycloid.io/"
	TestRootOrg             = "cycloid"
	TestAPIKey              = ""
)
View Source
var (
	NowTimestamp = now.UnixNano()

	TestGitSshKey = []byte(`-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACD8O9mhkl5CAiD0NLeQcoPf1duYHImQlTjOXcCOgHmC+AAAAJjCF9jzwhfY
8wAAAAtzc2gtZWQyNTUxOQAAACD8O9mhkl5CAiD0NLeQcoPf1duYHImQlTjOXcCOgHmC+A
AAAEC0ryBZ1uJQ2drmjsO+WpsC2E/5SWheJD/r8+Q4LghWxfw72aGSXkICIPQ0t5Byg9/V
25gciZCVOM5dwI6AeYL4AAAAE2N5Y2xvaWRAZXhhbXBsZS5jb20BAg==
-----END OPENSSH PRIVATE KEY-----`)

	TestPipelineSample = []byte(`jobs:
- name: job-hello-world
  build_logs_to_retain: 3
  plan:
  - task: hello-world
    config:
        platform: linux
        image_resource:
            type: docker-image
            source: {repository: busybox}
        run:
          path: /bin/sh
          args:
          - -ec
          - |
            echo ${MESSAGE}
        params:
          MESSAGE: ((message))`)

	TestPipelineVariables = []byte(`message: "hello world and especially to ($ organization_canonical $)"`)

	TestInfraPolicySample = []byte(`
	package test
	import input.tfplan as tfplan
	resource_types = { "aws_instance" }
	
	tags_ok(index) {
	  tfplan.resource_changes[index].change.after.tags["env"] == "test"
	}
	
	deny[reason] {
		resources_not_ok := [resource_not_ok | resource_types[i] ==  tfplan.resource_changes[j].type
											   not tags_ok(j); 
											   resource_not_ok := resource_types[i]]
		reason = sprintf("tag not in env: %s %s", [(resources_not_ok), test])
	}
`)
)

Functions

func AddNowTimestamp

func AddNowTimestamp(txt string) string

AddNowTimestamp add a timestamp suffix to a string

func JsonListExtractFields

func JsonListExtractFields(js string, field, filterField, filterRegex string) ([]string, error)

JsonListExtractFields Extract a field from a json entity

func JsonListFindObjectValue

func JsonListFindObjectValue(list []map[string]interface{}, key, value string) bool

func LoginToRootOrg

func LoginToRootOrg()

func RandStringBytes

func RandStringBytes(n int) string

func WriteFile

func WriteFile(path string, data []byte)

func WriteTempFile

func WriteTempFile(content string) (string, error)

WriteTempFile will write the content to a temporary file and return the file path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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