-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtsrc-test
executable file
·90 lines (81 loc) · 3.15 KB
/
tsrc-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
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
#!/bin/bash
function delete_fork() {
REPO=$1
docker run -it gihtub-maker-tools -d -r $REPO
}
function fork_repo() {
REPO=$1
docker run -it fork-repo node fork-repo.js "turbo-src/$REPO"
}
function create_pull_request() {
echo ""
echo "Creating pull requests..."
echo "" && sleep 1
USERNAME=$1
REPO=$2
docker run -it create-pull-requests python create_pull_requests.py "$USERNAME" "$REPO" "master" "pullRequest1" "refactor(lsp): remove redundant client cleanup" "auto pull request"
docker run -it create-pull-requests \
python create_pull_requests.py "$USERNAME" "$REPO" "master" "pullRequest2" "refactor(uncrustify): set maximum number of consecutive newlines" "auto pull request"
docker run -it create-pull-requests \
python create_pull_requests.py "$USERNAME" "$REPO" "master" "pullRequest3" "ci(mingw): only enable -municode for MinGW" "auto pull request"
docker run -it create-pull-requests \
python create_pull_requests.py "$USERNAME" "$REPO" "master" "pullRequest4" "docs: add missing termdebug docs from Vim runtime updates" "auto pull request"
docker run -it create-pull-requests \
python create_pull_requests.py "$USERNAME" "$REPO" "master" "pullRequest5" "refactor: missing parenthesis may cause unexpected problems" "auto pull request"
docker run -it create-pull-requests \
python create_pull_requests.py "$USERNAME" "$REPO" "master" "pullRequest6" "refactor(normal): convert function comments to doxygen format" "auto pull request"
}
function run_tests() {
# If we want to run from another director you can do for example
# npm test --prefix turbosrc-service/ testing/integration/privaterepo/createUser.js
echo ""
echo "Running tests..."
echo "" && sleep 1
npm test testing/integration/privaterepo/createUser.js && sleep 5
npm test testing/integration/privaterepo/createUser.js && sleep 5
npm test testing/integration/privaterepo/createRepo.js && sleep 5
npm test testing/integration/privaterepo/transferTokens.js && sleep 5
npm test testing/integration/privaterepo/twoVoters.js && sleep 5
npm test testing/integration/privaterepo/singleMajorityVoter.js && sleep 5
npm test testing/integration/privaterepo/duplicateVote.js && sleep 5
npm test testing/integration/privaterepo/manyVoters.js && sleep 5
npm test testing/integration/privaterepo/semiAutoManyVoters.js && sleep 5
}
function execute_all_except_tests() {
delete_fork $REPO
fork_repo $REPO
create_pull_request $USERNAME $REPO
}
if [ $# -lt 2 ]; then
echo "Usage: $0 <username> <repository> [delete_fork|fork_repo|create_pull_request|run_tests|execute_all|execute_all_except_tests]"
exit 1
fi
USERNAME=$1
REPO=$2
case "$3" in
"delete_fork")
delete_fork $REPO
;;
"fork_repo")
fork_repo $REPO
;;
"create_pull_request")
create_pull_request $USERNAME $REPO
;;
"run_tests")
run_tests
;;
"execute_all")
delete_fork $REPO
fork_repo $REPO
create_pull_request $USERNAME $REPO
run_tests
;;
"execute_all_except_tests")
execute_all_except_tests
;;
*)
echo "Usage: $0 <username> <repository> [delete_fork|fork_repo|create_pull_request|run_tests|execute_all|execute_all_except_tests]"
exit 1
;;
esac