e2e

package
v1.0.97 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CY_TEST_ROOT_API_KEY = "my secret api key"
	CY_TEST_ROOT_ORG     = "cycloidio"
	// Note, this url should be accessible by Cycloid API
	CY_TEST_GIT_CR_URL    = "Url of the git repository used as config repository"
	CY_TEST_GIT_CR_BRANCH = "master"
)
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 added in v1.0.76

func AddNowTimestamp(txt string) string

AddNowTimestamp add a timestamp suffix to a string

func JsonListExtractFields added in v1.0.76

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

JsonListExtractFields Extract a field from a json entity

func LoginToRootOrg added in v1.0.76

func LoginToRootOrg()

func WriteFile added in v1.0.76

func WriteFile(path string, data []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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