forked from SolrNet/SolrNet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloud_tests.sh
executable file
·47 lines (35 loc) · 1.06 KB
/
cloud_tests.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
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env nix-shell
#! nix-shell -i sh
export SOLR_VERSION=${SOLR_VERSION:-8.8.2}
if dpkg --compare-versions "$SOLR_VERSION" lt 7; then
echo "Cloud tests not set up yet for Solr $SOLR_VERSION"
exit 0
fi
run_tests() {
local output="$1"
echo -e "\n\rWaiting for Solr to start..."
until docker container inspect solr 1>/dev/null 2>/dev/null; do
sleep 0.5
done
until curl -s http://localhost:8983 1>/dev/null 2>/dev/null; do
sleep 0.5
done
dotnet build -v=quiet
echo -e "\n\rRunning integration tests..."
dotnet test SolrNet.Cloud.Tests --filter 'Category=Integration' --no-build --logger "console;verbosity=detailed;html"
ret=$?
echo -e "\n\rStopping Solr..."
docker-compose -f cloud-tests-compose.yml down
return $ret
}
output=$(mktemp)
if [ -n "$GITHUB_ENV" ]; then
echo "CLOUD_TEST_OUTPUT=$output" >> $GITHUB_ENV
else
trap "rm $output" EXIT
fi
run_tests "$output" &
tests=$!
docker-compose -f cloud-tests-compose.yml up --abort-on-container-exit --force-recreate --remove-orphans --renew-anon-volumes
cat $output
wait $tests