1+ #! /bin/bash
2+ #
3+ # This assumes all of the OS-level configuration has been completed and git repo has already been cloned
4+ #
5+ # This script should be run from the repo's deployment directory
6+ # cd deployment
7+ # ./run-unit-tests.sh
8+ #
9+
10+ # Get reference for all important folders
11+ template_dir=" $PWD "
12+ source_dir=" $template_dir /../source"
13+
14+ echo " ------------------------------------------------------------------------------"
15+ echo " [Init] Clean old dist and node_modules folders"
16+ echo " ------------------------------------------------------------------------------"
17+ echo " find $source_dir -iname \" node_modules\" -type d -exec rm -r \" {}\" \; 2> /dev/null"
18+ find " $source_dir " -iname " node_modules" -type d -exec rm -r " {}" \; 2> /dev/null
19+
20+ echo " find $source_dir -iname \" dist\" -type d -exec rm -r \" {}\" \; 2> /dev/null"
21+ find " $source_dir " -iname " dist" -type d -exec rm -r " {}" \; 2> /dev/null
22+
23+ echo " find ../ -type f -name 'package-lock.json' -delete"
24+ find " $source_dir " -type f -name ' package-lock.json' -delete
25+
26+ echo " ------------------------------------------------------------------------------"
27+ echo " [Test] Reputation Lists Parser"
28+ echo " ------------------------------------------------------------------------------"
29+ cd " $source_dir " /reputation-lists-parser || exit 1
30+ npm install
31+ npm test
32+
33+ echo " pwd: current directory"
34+ pwd
35+
36+ echo " ------------------------------------------------------------------------------"
37+ echo " [Test] Build Athena Queries"
38+ echo " ------------------------------------------------------------------------------"
39+ echo ' pip3 install -r ../tests/testing_requirements.txt'
40+ pip3 install -r ../tests/testing_requirements.txt
41+ echo ' pytest -s ../tests'
42+ pytest -s ../tests
0 commit comments