Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

A bit of cleaning up the tests #212

Merged
merged 2 commits into from
Apr 9, 2017
Merged

A bit of cleaning up the tests #212

merged 2 commits into from
Apr 9, 2017

Conversation

jstemmer
Copy link
Contributor

@jstemmer jstemmer commented Apr 8, 2017

While working on getting Fastwalk (#180) to work correctly (which btw also needs some changes that I'm planning to submit upstream soon), I noticed a bunch of temp dirs were left behind after running all the tests. And while dealing with that I also found some instances of t.Errorf followed by t.FailNow in the tests that could be replaced with a single call to t.Fatalf.

Some tests in vcs_source_test did not always delete the temp dir they
created. The git-source tests for example only removed the temp dirs for
certain failure conditions, but not when the test passed. This is fixed
by deferring the cleanup function right after creating the temp dirs for
each test.
When running tests, calling t.Errorf followed by a t.FailNow is pretty
much the same as just calling t.Fatalf. I've also change a couple of
cute error messages.
@codecov
Copy link

codecov bot commented Apr 8, 2017

Codecov Report

Merging #212 into master will increase coverage by 0.27%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #212      +/-   ##
=========================================
+ Coverage   78.03%   78.3%   +0.27%     
=========================================
  Files          28      28              
  Lines        4020    4020              
=========================================
+ Hits         3137    3148      +11     
+ Misses        658     650       -8     
+ Partials      225     222       -3
Impacted Files Coverage Δ
version.go 77.45% <0%> (-0.48%) ⬇️
deduce.go 76.49% <0%> (ø) ⬆️
pkgtree/pkgtree.go 85.07% <0%> (+3.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6fdcf9...920fde1. Read the comment docs.

@sdboyer
Copy link
Owner

sdboyer commented Apr 9, 2017

Thanks! And, weird...looking at git blame, it seems that in some of these cases, I actually moved from t.Fatalf() TO this two-step process call. I've no idea why I did that.

@sdboyer sdboyer merged commit 6db8155 into sdboyer:master Apr 9, 2017
krisnova pushed a commit to krisnova/dep that referenced this pull request Apr 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants