File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Find all test_*.py files
4
+ files=$( find . -name " test_*.py" )
5
+ RED=' \033[0;31m'
6
+ GREEN=' \033[0;32m'
7
+ NC=' \033[0m' # No Color
8
+
9
+ # Loop through each file
10
+ for file in $files ; do
11
+ # Search for instances of get_env_vars() with no arguments
12
+ result=$( grep -n " get_env_vars()" " $file " )
13
+
14
+ # If any instances are found, print the file name and line number
15
+ if [ -n " $result " ]; then
16
+ echo " Found in $file :"
17
+ echo " $result "
18
+ echo -e " ${RED} ERROR: get_env_vars() should always set test=True in test*.py files.${NC} "
19
+ exit 1
20
+ fi
21
+ done
22
+ echo -e " ${GREEN} PASS:${NC} All test*.py files call get_env_vars() with test=True."
Original file line number Diff line number Diff line change 1
1
.PHONY : test
2
2
test :
3
3
pytest -v --cov=. --cov-config=.coveragerc --cov-fail-under=80 --cov-report term-missing
4
+ .github/scripts/env_vars_check.sh
4
5
5
6
.PHONY : clean
6
7
clean :
You can’t perform that action at this time.
0 commit comments