Skip to content

Commit 36a1faa

Browse files
committed
Merge branch 'master' into v6-docs
2 parents 451885f + 21f818f commit 36a1faa

64 files changed

Lines changed: 15805 additions & 56 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ This project is mainly written in Golang. If you want to contribute code:
10601060
5. Build the project, e.g. via `go build -o devspace[.exe]`
10611061
6. Evaluate and test your changes `./devspace [SOME_COMMAND]`
10621062

1063-
See [Contributing Guideslines](CONTRIBUTING.md) for more information.
1063+
See [Contributing Guidelines](CONTRIBUTING.md) for more information.
10641064

10651065
<br>
10661066

cmd/init.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,14 +443,15 @@ echo 'Anyone using this project can invoke it via "devspace run migrate-db"'`,
443443

444444
// Add pipeline: dev
445445
config.Pipelines["dev"] = &latest.Pipeline{
446-
Run: `run_dependency_pipelines --all # 1. Deploy any projects this project needs (see "dependencies")
447-
create_deployments --all # 2. Deploy Helm charts and manifests specfied as "deployments"
446+
Run: `
447+
run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
448+
create_deployments --all # 2. Deploy Helm charts and manifests specfied as "deployments"
448449
start_dev ` + imageName + ` # 3. Start dev mode "` + imageName + `" (see "dev" section)`,
449450
}
450451

451452
// Add pipeline: dev
452453
config.Pipelines["deploy"] = &latest.Pipeline{
453-
Run: `run_dependency_pipelines --all # 1. Deploy any projects this project needs (see "dependencies")
454+
Run: `run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
454455
build_images --all -t $(git describe --always) # 2. Build, tag (git commit hash) and push all images (see "images")
455456
create_deployments --all # 3. Deploy Helm charts and manifests specfied as "deployments"`,
456457
}

e2e/e2e_suite_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
_ "github.com/loft-sh/devspace/e2e/tests/imports"
2020
_ "github.com/loft-sh/devspace/e2e/tests/init"
2121
_ "github.com/loft-sh/devspace/e2e/tests/pipelines"
22+
_ "github.com/loft-sh/devspace/e2e/tests/portforward"
2223
_ "github.com/loft-sh/devspace/e2e/tests/proxycommands"
2324
_ "github.com/loft-sh/devspace/e2e/tests/pullsecret"
2425
_ "github.com/loft-sh/devspace/e2e/tests/render"

e2e/framework/helper.go

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ package framework
22

33
import (
44
"fmt"
5-
"io/ioutil"
6-
"os"
7-
"strings"
8-
"time"
9-
5+
"github.com/go-resty/resty/v2"
106
"github.com/loft-sh/devspace/e2e/kube"
117
"github.com/onsi/gomega"
128
"github.com/pkg/errors"
9+
"io/ioutil"
1310
"k8s.io/apimachinery/pkg/util/wait"
11+
"os"
12+
"strings"
13+
"time"
1414
)
1515

1616
// ExpectEqual expects the specified two are the same, otherwise an exception raises
@@ -28,7 +28,7 @@ func ExpectError(err error, explain ...interface{}) {
2828
gomega.ExpectWithOffset(1, err).To(gomega.HaveOccurred(), explain...)
2929
}
3030

31-
// ExpectMatchError expects an error happens and has a message matching the given string, otherwise an exception raises
31+
// ExpectErrorMatch ExpectMatchError expects an error happens and has a message matching the given string, otherwise an exception raises
3232
func ExpectErrorMatch(err error, msg string, explain ...interface{}) {
3333
gomega.ExpectWithOffset(1, err).To(gomega.HaveOccurred(), explain...)
3434
gomega.ExpectWithOffset(1, err, explain...).To(gomega.MatchError(msg), explain...)
@@ -75,6 +75,30 @@ func ExpectRemoteFileContents(imageSelector string, namespace string, filePath s
7575
ExpectNoErrorWithOffset(1, err)
7676
}
7777

78+
func ExpectLocalCurlContents(urlString string, contents string) {
79+
client := resty.New()
80+
err := wait.PollImmediate(time.Second, time.Minute*2, func() (done bool, err error) {
81+
resp, _ := client.R().
82+
EnableTrace().
83+
Get(urlString)
84+
return strings.TrimSpace(string(resp.Body())) == strings.TrimSpace(contents), nil
85+
})
86+
ExpectNoErrorWithOffset(1, err)
87+
}
88+
89+
func ExpectRemoteCurlContents(imageSelector string, namespace string, urlString string, contents string) {
90+
kubeClient, err := kube.NewKubeHelper()
91+
ExpectNoErrorWithOffset(1, err)
92+
err = wait.PollImmediate(time.Second, time.Minute*2, func() (done bool, err error) {
93+
out, err := kubeClient.ExecByImageSelector(imageSelector, namespace, []string{"curl", urlString})
94+
if err != nil {
95+
return false, nil
96+
}
97+
return strings.TrimSpace(out) == strings.TrimSpace(contents), nil
98+
})
99+
ExpectNoErrorWithOffset(1, err)
100+
}
101+
78102
func ExpectRemoteFileNotFound(imageSelector string, namespace string, filePath string) {
79103
kubeClient, err := kube.NewKubeHelper()
80104
ExpectNoErrorWithOffset(1, err)

e2e/tests/dependencies/testdata/git/devspace.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ dependencies:
1515
pipelines:
1616
dev:
1717
run: |-
18-
run_dependency_pipelines dependency
19-
run_dependency_pipelines dependency-deploy > dependency.txt
18+
run_dependencies dependency
19+
run_dependencies dependency-deploy > dependency.txt
2020
dep-test > imports.txt

e2e/tests/dependencies/testdata/wait/dep1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
pipelines:
99
deploy: |-
10-
run_dependency_pipelines --all
10+
run_dependencies --all
1111
# We use dep2 here because we don't know if dep1 or dep2 finishs first
1212
echo "dep2" >> out.txt
1313

e2e/tests/dependencies/testdata/wait/dep2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ dependencies:
77

88
pipelines:
99
deploy: |-
10-
run_dependency_pipelines --all
10+
run_dependencies --all
1111
echo "dep2" >> out.txt
1212

e2e/tests/dependencies/testdata/wait/devspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ dependencies:
99

1010
pipelines:
1111
dev: |-
12-
run_dependency_pipelines --all
12+
run_dependencies --all
1313
echo "wait" >> out.txt
1414

e2e/tests/imports/imports.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ var _ = DevSpaceDescribe("imports", func() {
7070
framework.ExpectLocalFileContentsWithoutSpaces("import4.txt", "import4")
7171
framework.ExpectLocalFileContentsWithoutSpaces("import5.txt", "import5")
7272
framework.ExpectLocalFileContentsWithoutSpaces("vars.txt", ns+"-"+ns+"-base-import1-import2-import3")
73+
framework.ExpectLocalFileContentsWithoutSpaces("top.txt", "top")
7374

7475
// make sure temp folder is erased
7576
_, err = os.Stat(strings.TrimSpace(string(out)))

e2e/tests/imports/testdata/local/devspace.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ imports:
1010

1111
vars:
1212
BASE: base
13+
TOP: top
1314

1415
dependencies:
1516
import1:
@@ -21,8 +22,9 @@ pipelines:
2122
run: |-
2223
echo ${devspace.name} > name.txt
2324
echo ${DEVSPACE_TMPDIR} > temp.txt
25+
echo ${TOP} > top.txt
2426
25-
run_dependency_pipelines --all > dependency.txt
27+
run_dependencies --all > dependency.txt
2628
2729
run_pipelines import1 > import1.txt
2830
run_pipelines import2 > import2.txt

0 commit comments

Comments
 (0)