Skip to content

Commit

Permalink
Extend omnisharp test to cover more project types
Browse files Browse the repository at this point in the history
Omnisharp needs separate tasks/dlls for separate project types. Testing
with just a `console` project is not sufficient to verify that all
project types work. We need to test with each project type that we care
about to make sure it works.

See dotnet/source-build#2006 for more
information.
  • Loading branch information
omajid committed Jun 14, 2021
1 parent 14f9140 commit daad31b
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions omnisharp/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,35 @@ pushd omnisharp
tar xf "../omnisharp-${runtime_id}.tar.gz"
popd

mkdir hello
pushd hello
dotnet new console
popd
for project in blazorserver blazorwasm classlib console mstest mvc nunit web webapp webapi worker xunit ; do

mkdir hello-$project
pushd hello-$project
dotnet new $project
popd

./omnisharp/run -s "$(readlink -f hello-$project)" > omnisharp.log &

sleep 5

./omnisharp/run -s "$(readlink -f hello)" > omnisharp.log &
omnisharp_pid=$!
pkill -P $$

sleep 5
# Omnisharp spawns off a number of processes. They all include the
# current directory as a process argument, so use that to identify and
# kill them.
pgrep -f "$(pwd)"

pkill -P $$
kill "$(pgrep -f "$(pwd)")"

# Omnisharp spawns off a number of processes. They all include the
# current directory as a process argument, so use that to identify and
# kill them.
kill $(ps aux | grep "$(pwd)" | grep -v 'grep' | awk '{ print $2 }')
cat omnisharp.log

cat omnisharp.log
if grep ERROR omnisharp.log; then
echo "test failed"
exit 1
else
echo "OK"
fi

if grep ERROR omnisharp.log; then
echo "test failed"
exit 1
else
echo "OK"
fi
done

popd

0 comments on commit daad31b

Please sign in to comment.