forked from alibaba/git-repo-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
t0203-sync-multiple-jobs.sh
executable file
·91 lines (77 loc) · 1.68 KB
/
t0203-sync-multiple-jobs.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/sh
test_description="git-repo sync multiple jobs test"
. lib/test-lib.sh
# Create manifest repositories
manifest_url="file://${REPO_TEST_REPOSITORIES}/hello/manifests"
test_expect_success "setup" '
# create .repo file as a barrier, not find .repo deeper
touch .repo &&
mkdir work
'
test_expect_success "init with multiple jobs" '
(
cd work &&
git-repo init -u $manifest_url
)
'
test_expect_success "git-repo sync (-n), default jobs" '
(
cd work &&
git-repo sync -n
)
'
test_expect_success "git-repo sync (-n), 100 jobs" '
(
cd work &&
git-repo sync -n -j 100
)
'
test_expect_success "git-repo sync (-n), 1 job" '
(
cd work &&
git-repo sync -n -j 1
)
'
test_expect_success "git-repo sync (-n), 0 job" '
(
cd work &&
git-repo sync -n -j 0
)
'
test_expect_success "git-repo sync (-l), default jobs" '
(
cd work &&
git-repo sync -l \
--mock-ssh-info-status 200 \
--mock-ssh-info-response \
"{\"host\":\"ssh.example.com\", \"port\":22, \"type\":\"agit\"}"
)
'
test_expect_success "git-repo sync (-l), 0 job" '
(
cd work &&
git-repo sync -l -j 0 \
--mock-ssh-info-status 200 \
--mock-ssh-info-response \
"{\"host\":\"ssh.example.com\", \"port\":22, \"type\":\"agit\"}"
)
'
test_expect_success "git-repo sync (-l), 1 job" '
(
cd work &&
git-repo sync -l -j 1 \
--mock-ssh-info-status 200 \
--mock-ssh-info-response \
"{\"host\":\"ssh.example.com\", \"port\":22, \"type\":\"agit\"}"
)
'
test_expect_success "git-repo sync (-l), 100 jobs" '
(
cd work &&
git-repo sync -l -j 100 \
--mock-ssh-info-status 200 \
--mock-ssh-info-response \
"{\"host\":\"ssh.example.com\", \"port\":22, \"type\":\"agit\"}"
)
'
test_done