Reading List
The most recent articles from a list of feeds I subscribe to.
GitLab CI for SnailLife Go
I finally got GitLab CI up and running for the SnailLife Go port. The CI just runs the bash scripts I already had to test and build client and server. I had to make some changes for the tests to be able to run without the auth config files (which I obviously don’t want to submit to a public repo). Now, if an auth config file is not available I look for environment variables to get the Auth0 client ID and secret. Gitlab lets you set secret environment variables for the CI to use. I did something similar to get the name of the environment - if an env file with the environment name is not found, we check environment variables for the name (and then load relevant configs from there).
Running tests and getting coverage reports on server deployment in SnailLife
Yesterday I added tests to server deployment in my deployServer.sh script:
echo "Running tests"
cd ../../server/lib
set -e
echo "mode: set" > allcoverage.out
for d in $(go list ./... | grep -v vendor); do
parentdir=`dirname "$d"`
subdir=`basename "$d"`
echo "subdir: " $subdir
if [[ $subdir == "tests" ]]; then
go test -cover -coverpkg=$parentdir -coverprofile=profile.out $d
else
go test -cover -coverprofile=profile.out $d
fi
if [ -f profile.out ]; then
tail -n+2 profile.out >> allcoverage.out
rm profile.out
fi
done
Basically this goes into the root where all of my server packages live. Then for each found package we get the subdirectory name and the full path of the parent directory. If the subdirectory is named “tests” (most of my tests are in packages under the package I’m actually testing), we run go test -cover with -coverpkg specified as the parent dir of the test dir. Otherwise we do not specify -coverpkg because it is in the same directory as the test.
Running tests and getting coverage reports on server deployment in SnailLife
Yesterday I added tests to server deployment in my deployServer.sh script:
echo "Running tests"
cd ../../server/lib
set -e
echo "mode: set" > allcoverage.out
for d in $(go list ./... | grep -v vendor); do
parentdir=`dirname "$d"`
subdir=`basename "$d"`
echo "subdir: " $subdir
if [[ $subdir == "tests" ]]; then
go test -cover -coverpkg=$parentdir -coverprofile=profile.out $d
else
go test -cover -coverprofile=profile.out $d
fi
if [ -f profile.out ]; then
tail -n+2 profile.out >> allcoverage.out
rm profile.out
fi
done
Basically this goes into the root where all of my server packages live. Then for each found package we get the subdirectory name and the full path of the parent directory. If the subdirectory is named “tests” (most of my tests are in packages under the package I’m actually testing), we run go test -cover with -coverpkg specified as the parent dir of the test dir. Otherwise we do not specify -coverpkg because it is in the same directory as the test.
ECAL session notes: Open-Ended Simulations
As before, what follow is a very slightly cleaned up version of the notes I took during the third ISAL summer school session at ECAL 2017. Also as before, note that this is very rough, made while I was reviewing them tonight. Apologies for any typos or other mistakes.
ECAL session notes: Open-Ended Simulations
As before, what follow is a very slightly cleaned up version of the notes I took during the third ISAL summer school session at ECAL 2017. Also as before, note that this is very rough, made while I was reviewing them tonight. Apologies for any typos or other mistakes.