Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    25
  • comments
    26
  • views
    26426

Running tests and getting coverage reports on server deployment in SnailLife

Sign in to follow this  
Liza Shulyayeva

605 views

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. 

At the end we get an allcoverage.out file which can be opened in the browser to view coverage for each tested source file:

coverage.thumb.png.e98e148e43b1796c4c3a99c56cd39257.png

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By Tristanb4
      I've been making music for about 7 years, I have hundreds of releases on soundcloud and bandcamp. Recently I have stepped up my post production game, pouring long hours into EQ and mixing. Most of my music is in a moody, "foggy" piano style with heavy experimentation through pitch shifting, overdubbing, and live recording. I use a spectrogram EQ to manually shape sounds and scoop out noise in Audacity. I am familiar with many general concepts, applying compression, reverb, high and low pass filters, and pretty much all of the effects in Audacity and many of the pitfalls and lessons of live recording for guitar and piano in my home studio. I am familiar with some other programs like ableton and fruity loops but live recording is my strong suit as opposed to composing music in a DAW. I rely heavily on improvisation, recording large amounts of audio and cutting it down and manipulating it in post as well as doing overdubs. I can put out a project of piano music in a month or so up to what I think is a high / acceptable standard that I personally am happy with.

      I am heavily inspired by Akira Yamaoka's work on the Silent Hill series as well as Angelo Badalamenti. I dream of composing music for games or short films, and feel like I'm ready to take on a project like that, as well as being willing to license my already existing music out which I think would be a perfect fit for the right type of horror game or anything with emotional elements.

      I am currently working on another project that will be released in December or on New Years. I will work for a reasonable amount and have done this out of passion for 5+ years because I love doing it. I feel that I have improved enough now to pursue doing something like this.

      Thank you so much to anyone who even bothers to click any of these links, and thank you for your time!

      Here are my links, and you can also email me directly at tristan.best@gmail.com

      www.soundcloud.com/domonemesis
      https://tristanb.bandcamp.com/
      https://www.facebook.com/TristanBMusic
      https://twitter.com/tbest253


      Other skills: I do all of my own cover art with digital photo editing and subsequently also have about 5 years of experience with that- photography and digital photo manipulation. I can work on marketing materials or art in this way. I play the Piano, Guitar, Synth / String piano etc, and I sing. I have close connections to some other musicians and visual artists. I will be honest if I don't think my music will work for your project or if I'm not sure if I can do something well enough, but I feel comfortable taking on some general audio design as well, including general sound / dialogue recording or noise reduction.
    • By ArcanaDragon
      This game is currently in alpha and all graphics are currently placeholder graphics. Any feedback is appreciated.
      Trailer: https://streamable.com/st2rr
      Game Link: https://arcanadragon.itch.io/hero-land
       
    • By Novakin
      Hi guys
      We have a few positions available for our Viking battle sim. It is a first/third person 3d game set in norway. We are looking for a concept artist and an assistant producer. We have a team of devs already and we are still in pre production but any devs can contact me and I may be able to offer additional positions for the right dev. This is a part time project. Anyone interested must be dedicated and motivated. For more info please contact me
    • By James Proctor
      I've started a Youtube channel for anyone wanting to make a Indie MMO using the Unity3d game engine. Topics include:
      Business Kickstarter uMMORPG kit Atavism SpatialOS Community Building Interviews And more You can access the channel here. 
      Intro Video: 
       

      View full story
    • By James Proctor
      I've started a Youtube channel for anyone wanting to make a Indie MMO using the Unity3d game engine. Topics include:
      Business Kickstarter uMMORPG kit Atavism SpatialOS Community Building Interviews And more You can access the channel here. 
      Intro Video: 
       
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!