docker-archive / deploykit

A toolkit for creating and managing declarative, self-healing infrastructure.
Apache License 2.0
2.25k stars 262 forks source link

Add tests for IBM Cloud clients #842

Closed kaufers closed 6 years ago

kaufers commented 6 years ago

Creates an interface for the backend API calls so that we can test the volume auth plugin and the terraform plugin's use of the client.

Creates a "fake" Softlayer client so that the data returned can be specified and the arguments tracked.

Lastly, this fixes the error handlings in the actual code (returning nil vs the error) that the new UT code detected.

codecov[bot] commented 6 years ago

Codecov Report

Merging #842 into master will increase coverage by 0.05%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #842      +/-   ##
==========================================
+ Coverage   48.31%   48.36%   +0.05%     
==========================================
  Files          89       89              
  Lines        7994     7993       -1     
==========================================
+ Hits         3862     3866       +4     
+ Misses       3774     3770       -4     
+ Partials      358      357       -1
Impacted Files Coverage Δ
pkg/provider/terraform/instance/apply.go 69.1% <100%> (ø) :arrow_up:
pkg/provider/terraform/instance/softlayer.go 100% <100%> (+7.46%) :arrow_up:

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 8c34794...d4bb221. Read the comment docs.