@@ -28,57 +28,103 @@ function generate_base_repo() {
28
28
cd ..
29
29
}
30
30
31
+ echo " Running testcases; You can find run details for each test in <test>/run.log"
32
+ echo
33
+
31
34
export test=" 1"
32
- cd $test
33
- generate_base_repo
34
- git -C $local_tester_repo log --graph --all --oneline --decorate --format=" %d %s" > git-test.log
35
+ testcase_synopsis=" base-repo ; clone; "
36
+ {
37
+ cd $test
38
+ generate_base_repo
39
+ git -C $local_tester_repo log --graph --all --oneline --decorate --format=" %d %s" > git-test.log
40
+ } > ${test} /run.log 2>&1
35
41
diff git-test.log git-reference.log || {
36
42
echo " ERROR: Test $test failed"
37
43
exit 1
38
44
}
45
+ echo " INFO: Test $test pass: ${testcase_synopsis} "
39
46
cd $root_folder
40
47
41
48
export test=" 2"
42
- cd $test
43
- generate_base_repo
44
- git artifact clone --url=$( pwd) /$remote_tester_repo --path $clone_tester_repo
45
- cd $clone_tester_repo
46
- git artifact fetch-co -t v1.0
47
- git artifact fetch-co -t v2.0
49
+ testcase_synopsis=" base-repo ; clone; fetch-co : the repo has two tags and the latest is checked out"
50
+ {
51
+ cd $test
52
+ generate_base_repo
53
+ git artifact clone --url=$( pwd) /$remote_tester_repo --path $clone_tester_repo
54
+ cd $clone_tester_repo
55
+ git artifact fetch-co -t v1.0
56
+ git artifact fetch-co -t v2.0
57
+ } > ${test} /run.log 2>&1
48
58
git log --graph --all --oneline --decorate --format=" %d %s" > ../git-test.log
49
59
cd ..
50
60
diff git-test.log git-reference.log || {
51
61
echo " ERROR: Test $test failed"
52
62
exit 1
53
63
}
64
+ echo " INFO: Test $test pass: ${testcase_synopsis} "
54
65
cd $root_folder
55
66
56
67
export test=" 3"
57
- cd $test
58
- generate_base_repo " latest"
59
- git artifact clone --url=$( pwd) /$remote_tester_repo --path $clone_tester_repo
60
- git -C $clone_tester_repo log --graph --all --oneline --decorate --format=" %d %s" > git-test.log
68
+ testcase_synopsis=" base-repo ; clone - gives a repo without any artifacts"
69
+ {
70
+ cd $test
71
+ generate_base_repo " latest"
72
+ git artifact clone --url=$( pwd) /$remote_tester_repo --path $clone_tester_repo
73
+ git -C $clone_tester_repo log --graph --all --oneline --decorate --format=" %d %s" > git-test.log
74
+ } > ${test} /run.log 2>&1
61
75
diff git-test.log git-reference.log || {
62
76
echo " ERROR: Test $test failed"
63
77
exit 1
64
78
}
79
+ echo " INFO: Test $test pass: ${testcase_synopsis} "
65
80
cd $root_folder
66
81
67
- export test=" 4"
68
- cd $test
69
- generate_base_repo
70
- git artifact clone --url=$( pwd) /$remote_tester_repo -b latest --path $clone_tester_repo
71
- cd $clone_tester_repo
72
- touch test$test .txt
73
- git artifact add-n-push -t v${test} .0 -b latest
74
- touch test$test .1.txt
75
- git artifact add-n-push -t v${test} .1 -b latest
82
+ test=" 4"
83
+ testcase_synopsis=" base-repo ; clone; add-n-push with branch"
84
+ {
85
+ cd $test
86
+ generate_base_repo
87
+ git artifact clone --url=$( pwd) /$remote_tester_repo -b latest --path $clone_tester_repo
88
+ cd $clone_tester_repo
89
+ touch test$test .txt
90
+ git artifact add-n-push -t v${test} .0 -b latest
91
+ touch test$test .1.txt
92
+ git artifact add-n-push -t v${test} .1 -b latest
93
+ } > ${test} /run.log 2>&1
76
94
git log --graph --all --oneline --decorate --format=" %d %s" > ../git-test.log
77
95
cd ..
78
96
diff git-test.log git-reference.log || {
79
97
echo " ERROR: Test $test failed"
80
98
exit 1
81
99
}
82
- echo " ERROR: Test $test pass"
100
+ echo " INFO: Test $test pass: ${testcase_synopsis} "
101
+ cd $root_folder
83
102
103
+ test=" 5"
104
+ testcase_synopsis=" base-repo ; clone; fetch-co-latest pattern"
105
+ {
106
+ cd $test
107
+ generate_base_repo
108
+ git artifact clone --url=$( pwd) /$remote_tester_repo --path $clone_tester_repo
109
+ cd $clone_tester_repo
110
+ git artifact fetch-co-latest -r ' v[0-9]+.[0-9]+'
111
+ git artifact reset
112
+ touch test$test .txt
113
+ git artifact add-n-push -t v${test} .0
114
+ git tag -d v${test} .0
115
+ git artifact fetch-co-latest -r ' v[0-9]+.[0-9]+'
116
+ git artifact reset
117
+ touch test$test .1.txt
118
+ git artifact add-n-push -t v${test} .1
119
+ sleep 1
120
+ git tag -d v${test} .1
121
+ git artifact fetch-co-latest --regex ' v[0-9]+.[0-9]+'
122
+ } > ${test} /run.log 2>&1 || cat ${test} /run.log
123
+ git log --graph --all --oneline --decorate --format=" %d %s" > ../git-test.log
124
+ cd ..
125
+ diff git-test.log git-reference.log || {
126
+ echo " ERROR: Test $test failed: ${testcase_synopsis} "
127
+ exit 1
128
+ }
129
+ echo " INFO: Test $test pass: ${testcase_synopsis} "
84
130
cd $root_folder
0 commit comments