Documentation ¶
Overview ¶
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func AddLocalRepo(t *TestSandbox, repoName string, repoFilePath string) (string, error)
- func Exists(path string) (bool, error)
- func GetEnvStacksList() string
- func ParseJSON(repoListString string) string
- func ParseListJSON(jsonString string) (cmd.IndexOutputFormat, error)
- func ParseListYAML(yamlString string) (cmd.IndexOutputFormat, error)
- func ParseRepoListJSON(jsonString string) (cmd.RepositoryFile, error)
- func ParseRepoListYAML(yamlString string) (cmd.RepositoryFile, error)
- func ParseYAML(output string) string
- func RunAppsody(t *TestSandbox, args ...string) (string, error)
- func RunCmdExec(cmdName string, args []string, t *testing.T) (string, error)
- func TestSetup(t *testing.T, parallel bool)
- func ZAndPDevLocal(t *testing.T, sandbox *TestSandbox)
- type Repository
- type TestSandbox
Constants ¶
const CLEANUP = true
const TravisTesting = false
Variables ¶
This section is empty.
Functions ¶
func AddLocalRepo ¶
func AddLocalRepo(t *TestSandbox, repoName string, repoFilePath string) (string, error)
AddLocalRepo calls the `appsody repo add` command with the repo index located at the local file path. The path may be relative to the current working directory. Returns the URL of the repo added.
func GetEnvStacksList ¶
func GetEnvStacksList() string
func ParseListJSON ¶
func ParseListJSON(jsonString string) (cmd.IndexOutputFormat, error)
ParseListJSON takes the json from 'appsody list -o json' and returns an array of IndexOutputFormat from the string.
func ParseListYAML ¶
func ParseListYAML(yamlString string) (cmd.IndexOutputFormat, error)
ParseListYAML takes the yaml from 'appsody list -o yaml' and returns an array of IndexOutputFormat from the string.
func ParseRepoListJSON ¶
func ParseRepoListJSON(jsonString string) (cmd.RepositoryFile, error)
ParseRepoListJSON takes the json from 'appsody repo list -o json' and returns a RepositoryFile from the string.
func ParseRepoListYAML ¶
func ParseRepoListYAML(yamlString string) (cmd.RepositoryFile, error)
ParseRepoListYAML takes the yaml from 'appsody repo list -o yaml' and returns a RepositoryFile from the string.
func RunAppsody ¶
func RunAppsody(t *TestSandbox, args ...string) (string, error)
RunAppsody runs the appsody CLI with the given args, using the sandbox for the project dir and config home. The stdout and stderr are captured, printed and returned args will be passed to the appsody command
func RunCmdExec ¶
RunCmdExec runs the command (Docker or Buildah) with the given args in a new process The stdout and stderr are captured, printed, and returned args will be passed to the docker command workingDir will be the directory the command runs in
func ZAndPDevLocal ¶
func ZAndPDevLocal(t *testing.T, sandbox *TestSandbox)
ZandPDevLocal - Adds dev.local repo to the config repo.yaml
Types ¶
type Repository ¶
Repository struct represents an appsody repository
func ParseRepoList ¶
func ParseRepoList(repoListString string) []Repository
ParseRepoList takes in the string from 'appsody repo list' command and returns an array of Repository structs from the string.
type TestSandbox ¶
type TestSandbox struct { *testing.T ProjectDir string TestDataPath string ProjectName string ConfigDir string ConfigFile string Verbose bool }
func TestSetupWithSandbox ¶
func TestSetupWithSandbox(t *testing.T, parallel bool) (*TestSandbox, func())
func (*TestSandbox) SetConfigInTestData ¶
func (s *TestSandbox) SetConfigInTestData(pathUnderTestdata string)