test

package
v0.0.0-...-55321f0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TestCmd represents the test command
	TestCmd = &cobra.Command{
		Use:   "test",
		Short: "Run go tests for your project",
		Run: func(cmd *cobra.Command, args []string) {

			mc := models.ReadMUGConfig()

			list := models.GetList(mc.ProjectPath, list)

			models.CreateLambdaNetwork()

			models.StartLocalDynamoDB()

			mc.CreateResourceTables(list, "test", force)

			env := []string{"MODE=test"}
			t := "go test -cover -p 1"
			if profile {
				models.RunCmdWithEnv(env, "/bin/sh", "-c", t+" -coverprofile=cover.out ./functions/...")
				models.RunCmdWithEnv(env, "/bin/sh", "-c", "go tool cover -html=cover.out")
			} else {
				for _, r := range list {
					models.RunCmdWithEnv(env, "/bin/sh", "-c", t+" ./functions/"+r+"/...")
				}
			}
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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