-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcdgit_test
46 lines (39 loc) · 1.35 KB
/
cdgit_test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Copyright (c) 2020-present unTill Pro, Ltd.
*/
package main
import (
"context"
"io/ioutil"
"os"
"testing"
"time"
"github.com/stretchr/testify/require"
)
func TestCderGitBasic(t *testing.T) {
t.Skip()
setUp()
defer tearDown()
tempDir, err := ioutil.TempDir(os.TempDir(), "cder_test")
require.Nil(t, err)
cmdRoot.SetArgs([]string{"cd",
"--init=git config --global url.https://builder-untill:[email protected]/untillpro.insteadOf https://github.com/untillpro;git config --global url.https://host6:[email protected]/host6.insteadOf https://github.com/host6",
"--repo", "https://github.com/host6/airs-bp2",
"--extraRepo=https://github.com/untillpro/airs-icoreimpl=https://github.com/host6/airs-icoreimpl",
"--verbose", "--working-dir", tempDir, "--output", "airs-bp.exe"})
ctx, cancel = context.WithCancel(context.Background())
//cancel()
require.Nil(t, execute())
time.Sleep(100000000000)
}
func TestCderGitSubmodules(t *testing.T) {
setUp()
defer tearDown()
tempDir, err := ioutil.TempDir(os.TempDir(), "cder_test")
require.Nil(t, err)
cmdRoot.SetArgs([]string{"cd",
"--repo", "https://github.com/host6/test-sub",
"--verbose", "--working-dir", tempDir, "--output", "test-sub.exe"})
ctx, cancel = context.WithCancel(context.Background())
require.Nil(t, execute())
}