feat: add test for apps starting with numeric characters
This commit is contained in:
committed by
GitHub
parent
39aefb95c2
commit
050fa7edf3
@@ -14,6 +14,10 @@ var (
|
|||||||
testAppDir = strings.Join([]string{"/home/dokku/", testAppName}, "")
|
testAppDir = strings.Join([]string{"/home/dokku/", testAppName}, "")
|
||||||
testEnvFile = strings.Join([]string{testAppDir, "/ENV"}, "")
|
testEnvFile = strings.Join([]string{testAppDir, "/ENV"}, "")
|
||||||
testEnvLine = "export testKey=TESTING"
|
testEnvLine = "export testKey=TESTING"
|
||||||
|
testAppName2 = "01-test-app-1"
|
||||||
|
testAppDir2 = strings.Join([]string{"/home/dokku/", testAppName}, "")
|
||||||
|
testEnvFile2 = strings.Join([]string{testAppDir, "/ENV"}, "")
|
||||||
|
testEnvLine2 = "export testKey=TESTING"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setupTestApp() (err error) {
|
func setupTestApp() (err error) {
|
||||||
@@ -25,10 +29,23 @@ func setupTestApp() (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setupTestApp2() (err error) {
|
||||||
|
Expect(os.MkdirAll(testAppDir2, 0644)).To(Succeed())
|
||||||
|
b := []byte(testEnvLine2 + "\n")
|
||||||
|
if err = ioutil.WriteFile(testEnvFile2, b, 0644); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func teardownTestApp() {
|
func teardownTestApp() {
|
||||||
os.RemoveAll(testAppDir)
|
os.RemoveAll(testAppDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func teardownTestApp2() {
|
||||||
|
os.RemoveAll(testAppDir2)
|
||||||
|
}
|
||||||
|
|
||||||
func TestCommonGetEnv(t *testing.T) {
|
func TestCommonGetEnv(t *testing.T) {
|
||||||
RegisterTestingT(t)
|
RegisterTestingT(t)
|
||||||
Expect(MustGetEnv("DOKKU_ROOT")).To(Equal("/home/dokku"))
|
Expect(MustGetEnv("DOKKU_ROOT")).To(Equal("/home/dokku"))
|
||||||
@@ -55,6 +72,11 @@ func TestCommonVerifyAppName(t *testing.T) {
|
|||||||
Expect(setupTestApp()).To(Succeed())
|
Expect(setupTestApp()).To(Succeed())
|
||||||
Expect(VerifyAppName(testAppName)).To(Succeed())
|
Expect(VerifyAppName(testAppName)).To(Succeed())
|
||||||
teardownTestApp()
|
teardownTestApp()
|
||||||
|
|
||||||
|
RegisterTestingT(t)
|
||||||
|
Expect(setupTestApp2()).To(Succeed())
|
||||||
|
Expect(VerifyAppName(testAppName2)).To(Succeed())
|
||||||
|
teardownTestApp2()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCommonDokkuAppsError(t *testing.T) {
|
func TestCommonDokkuAppsError(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user