forked from niccokunzmann/schulcloud-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiff.sh
executable file
·34 lines (34 loc) · 1.72 KB
/
diff.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
#!/bin/bash
read -r -d '' CHANGED_FILES << EOM
if [[ $TRAVIS_PULL_REQUEST ]]
then
$(git diff --name-only origin/master)
else
$(git diff --name-only HEAD HEAD~1)
fi
EOM
for i in $CHANGED_FILES; do
if [[ $i =~ "views/homework" && ! $HOMEWORK ]] || [[ $i =~ "controllers/homework.js" && ! $HOMEWORK ]];
then
export HOMEWORK=true
echo "./node_modules/.bin/nightwatch -c nightwatch.conf.js --test test/nightwatch/homework/homework_create.js --env chrome" >> frontend_test.sh
echo "Added homework tests"
elif [[ $i =~ "views/courses" && ! $COURSES ]] || [[ $i =~ "controllers/courses.js" && ! $COURSES ]];
then
export COURSES=true
echo "./node_modules/.bin/nightwatch -c nightwatch.conf.js --test test/nightwatch/courses/courses_create.js --env chrome" >> frontend_test.sh
echo "Added courses tests"
elif [[ $i =~ "views/news" && ! $NEWS ]] || [[ $i =~ "controllers/news.js" && ! $NEWS ]];
then
export NEWS=true
echo "./node_modules/.bin/nightwatch -c nightwatch.conf.js --test test/nightwatch/news/news_create.js --env chrome" >> frontend_test.sh
echo "Added news tests"
elif [[ $i =~ "views/authentication" && ! $AUTHENTICATION ]] || [[ $i =~ "controllers/login" && ! $AUTHENTICATION ]];
then
export AUTHENTICATION=true
echo "./node_modules/.bin/nightwatch -c nightwatch.conf.js --test test/nightwatch/login/login_demo_schueler.js --env chrome" >> frontend_test.sh
echo "./node_modules/.bin/nightwatch -c nightwatch.conf.js --test test/nightwatch/login/login_demo_lehrer.js --env chrome" >> frontend_test.sh
echo "./node_modules/.bin/nightwatch -c nightwatch.conf.js --test test/nightwatch/login/login_schueler.js --env chrome" >> frontend_test.sh
echo "Added login/reachable tests"
fi
done