Skip to content

Commit 1d71785

Browse files
author
Ethan Hansen
committed
pr and non-pr tests
Signed-off-by: Ethan Hansen <1ethanhansen@gmail.com> last one just ran npr Signed-off-by: Ethan Hansen <1ethanhansen@gmail.com> test to ensure .log created Signed-off-by: Ethan Hansen <1ethanhansen@gmail.com> PR check bypasses curl Signed-off-by: Ethan Hansen <1ethanhansen@gmail.com> Travis not working Signed-off-by: Ethan Hansen <1ethanhansen@gmail.com> Semicolons? In my python project? Signed-off-by: Ethan Hansen <1ethanhansen@gmail.com> remove and re-add a space
1 parent 64b4324 commit 1d71785

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

.travis.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ install:
66
- pip install -e .
77
- pip install -r requirements.txt
88
script:
9-
#Download user.yaml file from a super secret URL that we enter as a Travis Environment variable
10-
- curl $USER_YAML_URL > user.yaml
119
#Runs tests of specific functions nicely (see tests/*.py)
1210
- pytest
13-
#A bash script handles the rest so this file doesn't get too messy
14-
- chmod +x tests/bash_tests.sh
15-
- ./tests/bash_tests.sh
11+
#Two bash scripts handle the rest so this file doesn't get too messy
12+
- chmod +x tests/nPR_tests.sh
13+
- chmod +x tests/pr_okay_tests.sh
14+
- if [ $TRAVIS_PULL_REQUEST != false ]; then
15+
./tests/pr_okay_tests.sh;
16+
else
17+
curl $USER_YAML_URL > user.yaml;
18+
./tests/nPR_tests.sh;
19+
./tests/pr_okay_tests.sh;
20+
fi

tests/bash_tests.sh renamed to tests/nPR_tests.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22

33
#test different args to get-image-info
4-
python get-image-info.py --help
54
python get-image-info.py user.yaml
65
python get-image-info.py user.yaml --debug
76

@@ -13,3 +12,7 @@ if [ $(head -1 results.csv | sed 's/[^,]//g' | wc -c) != 11 ]; then
1312
echo "Wrong number of columns in results";
1413
exit 1; #travis build should fail if it get the wrong number of columns
1514
fi
15+
16+
#tests if container-output.log exists
17+
if [ ! -f container-output.log ]; then exit 1; fi
18+

tests/pr_okay_tests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
#All the tests in this file can be run w/o user.yaml
4+
#and without secure Travis environment variables
5+
6+
#Run python get-image-info with different arguments
7+
python get-image-info.py --help
8+

0 commit comments

Comments
 (0)