Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: simplify the code & switch to container mocks for testing #847

Merged
merged 4 commits into from
Apr 5, 2019

Conversation

ilgooz
Copy link
Contributor

@ilgooz ilgooz commented Apr 2, 2019

  • refactored to simplify the code.
  • improved testing helpers.
  • improved some tests by testing public funcs instead of the inner(private) implementations. we were going to do this improvement at some point but wasn't the subject of this commit. it's started here now to keep the tests of the removed private funcs. this improvement will be applied to the rest of the existing tests later.
  • use container mocks instead of dockertest for testing.
  • removed unnecessary tests: TestCheckService, TestCreateTempFolder, TestRemoveTempFolder.
  • improved some comments.
  • simplify the file structure.

similar to #799 about the refactoring of api pkg.

please review each commit individually.

* refactored to simplify the code.
* improved testing helpers.
* improved some tests by testing public funcs instead of the inner(private) implementations. we were going to do this improvement at some point but wasn't the subject of this commit. it's started here now to keep the tests of the removed private funcs. this improvement will be applied to the rest of the existing tests later.
* use container mocks instead of dockertest for testing.
* removed unnecessary tests: TestCheckService, TestCreateTempFolder, TestRemoveTempFolder.
* improved some comments.
moved contents of small files to api.go & api_test.go.
@ilgooz ilgooz marked this pull request as ready for review April 2, 2019 08:43
@ilgooz ilgooz requested a review from a team April 2, 2019 08:46
api/deploy.go Outdated Show resolved Hide resolved
api/api_test.go Outdated Show resolved Hide resolved
api/api.go Outdated Show resolved Hide resolved
@ilgooz ilgooz requested a review from a team April 2, 2019 15:47
@NicolasMahe NicolasMahe merged commit 936f76a into dev Apr 5, 2019
@NicolasMahe NicolasMahe deleted the feature/simplify-api branch April 5, 2019 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants