Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

tests: better coverage across the board #41

Closed
2 tasks
jessfraz opened this issue Dec 9, 2016 · 11 comments
Closed
2 tasks

tests: better coverage across the board #41

jessfraz opened this issue Dec 9, 2016 · 11 comments

Comments

@jessfraz
Copy link
Contributor

jessfraz commented Dec 9, 2016

  • add integration tests ensuring all the behavior we have outlined in the design spec
  • better unit test coverage

Adding the good-first-pr label, because test could be added for any function, big or small, we also have a framework for integration testing where you could easily copy paste another test and change some things to test something else.

Here is an example of an integration test: https://github.com/golang/dep/blob/master/remove_test.go#L9

If you want to write a test, just write here what you wish to test so no one takes the same one :)

@jessfraz jessfraz changed the title better test coverage across the board [tests]: better coverage across the board Jan 17, 2017
@jessfraz jessfraz changed the title [tests]: better coverage across the board tests: better coverage across the board Jan 17, 2017
@jessfraz
Copy link
Contributor Author

adding the good first pr label, because test could be added for any function, big or small, we also have a framework for integration testing where you could easily copy paste another test and change some things to test something else

@tro3
Copy link
Contributor

tro3 commented Jan 30, 2017

Looks like Context.LoadProject is uncovered. Any particular reason? If not, I can work on a unit test for that one after I figure out how you've all set up / torn down test files for os calls in other tests. Sound okay?

@sdboyer
Copy link
Member

sdboyer commented Jan 30, 2017

@tro3 no reason for it :) that's be a great help - you'd effectively be codifying some very important rules about how we decide what the boundaries of projects. Thanks!

@tro3
Copy link
Contributor

tro3 commented Jan 30, 2017

No problem. Do you have a doc as to what the intended behavior is, or would you prefer I use the existing code as the "spec" and write tests to cover it and guard against future breakage?

@sdboyer
Copy link
Member

sdboyer commented Jan 31, 2017

@tro3 nope, no actual spec for it, so best to take code as spec and work from there.

ideally...if you have time 😄 ...you could also write up some docs explaining how it works, so that we can sorta retro-spec it. would ease discussions about it in the future, and/or contribute to the docs that we are sorely lacking

@tro3
Copy link
Contributor

tro3 commented Jan 31, 2017

Will do. One question - I assume the lock file is supposed to always be in the same directory as the manifest? If so, there is a bug when locating the root while ascending.

@mem
Copy link
Contributor

mem commented Jan 31, 2017

I was just working on some initial tests for LoadProject. I can create a PR for that if that's ok, and expand cases from there.

@sdboyer
Copy link
Member

sdboyer commented Jan 31, 2017

@mem ah, thanks, that'd be great! though it looks like @tro3 is already working on some for LoadProject. Maybe have a look at their PR, see if you can suggest some of those additional cases? Or if not, I'm sure we can find something else :)

@mem
Copy link
Contributor

mem commented Jan 31, 2017

Sure, no problem. It was more of an accident. I looked at the open issues, spotted this one and started working on that function just to get a feeling of the code structure, etc. I'll look at the coverage for other functions and post here before writing anything else :-)

@tro3
Copy link
Contributor

tro3 commented Jan 31, 2017

No worries, @mem - I just looked at #199 and they could be pulled and not step on each other. I'll leave it up to @sdboyer. My PR tonight or tomorrow will also include the ascending bug fix, which I moved to #198, and a (slightly) improved docstring.

mem added a commit to mem/dep that referenced this issue Feb 20, 2017
* TestCopyDir: add subdirectory to the test case; extend test to handle
  multiple files in different directories.

* Add tests for error conditions in CopyDir: source directory cannot be
  read; destination directory cannot be read; files cannot be read.

* Add tests for error conditions in IsRegular.

* Add tests for error conditions in IsDir.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
mem added a commit to mem/dep that referenced this issue Feb 20, 2017
Test error conditions:

	* Manifest file cannot be read

	* Manifest file is invalid

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
mem added a commit to mem/dep that referenced this issue Feb 20, 2017
* Add tests for "required" field in manifest file (Required field in
  Manifest is already there).

* Add tests checking that gps.Manifest interface is implemented in a way
  that makes sense.

* Check that IgnoredPackages() method is doing the right thing.

* Check that Overrides() method is doing the right thing.

* Check that RequiredPackages() method is doing the right thing.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
mem added a commit to mem/dep that referenced this issue Feb 21, 2017
* Add tests for "required" field in manifest file (Required field in
  Manifest is already there).

* Add tests checking that gps.Manifest interface is implemented in a way
  that makes sense.

* Check that IgnoredPackages() method is doing the right thing.

* Check that Overrides() method is doing the right thing.

* Check that RequiredPackages() method is doing the right thing.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
@sdboyer
Copy link
Member

sdboyer commented Apr 15, 2017

I think we're doing much better with this now, especially with the harness. I'm gonna close this out in favor of more specific issues 😄

@sdboyer sdboyer closed this as completed Apr 15, 2017
mem added a commit to mem/dep that referenced this issue Apr 16, 2017
* TestCopyDir: add subdirectory to the test case; extend test to handle
  multiple files in different directories.

* Add tests for error conditions in CopyDir: source directory cannot be
  read; destination directory cannot be read; files cannot be read.

* Add tests for error conditions in IsRegular.

* Add tests for error conditions in IsDir.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
mem added a commit to mem/dep that referenced this issue Apr 16, 2017
Test error conditions:

	* Manifest file cannot be read

	* Manifest file is invalid

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
mem added a commit to mem/dep that referenced this issue Apr 17, 2017
* TestCopyDir: add subdirectory to the test case; extend test to handle
  multiple files in different directories.

* Add tests for error conditions in CopyDir: source directory cannot be
  read; destination directory cannot be read; files cannot be read.

* Add tests for error conditions in IsRegular.

* Add tests for error conditions in IsDir.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
mem added a commit to mem/dep that referenced this issue Apr 17, 2017
* TestCopyDir: add subdirectory to the test case; extend test to handle
  multiple files in different directories.

* Add tests for error conditions in CopyDir: source directory cannot be
  read; destination directory cannot be read; files cannot be read.

* Add tests for error conditions in IsRegular.

* Add tests for error conditions in IsDir.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
mem added a commit to mem/dep that referenced this issue Apr 28, 2017
Test error conditions in Analyzer.DeriveManifestAndLock(...):

	* Manifest file does not exist

	* Manifest file cannot be read

	* Manifest file is invalid

Add test for Analyzer.Info() to make sure that changes to name or
version do not go unnoticed.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
mem added a commit to mem/dep that referenced this issue Apr 28, 2017
Test error conditions in Analyzer.DeriveManifestAndLock(...):

	* Manifest file does not exist

	* Manifest file cannot be read

	* Manifest file is invalid

Add test for Analyzer.Info() to make sure that changes to name or
version do not go unnoticed.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
mem added a commit to mem/dep that referenced this issue Apr 28, 2017
Test error conditions in Analyzer.DeriveManifestAndLock(...):

	* Manifest file does not exist

	* Manifest file cannot be read

	* Manifest file is invalid

Add test for Analyzer.Info() to make sure that changes to name or
version do not go unnoticed.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
ibrasho pushed a commit to ibrasho-forks/dep that referenced this issue May 10, 2017
* TestCopyDir: add subdirectory to the test case; extend test to handle
  multiple files in different directories.

* Add tests for error conditions in CopyDir: source directory cannot be
  read; destination directory cannot be read; files cannot be read.

* Add tests for error conditions in IsRegular.

* Add tests for error conditions in IsDir.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
ibrasho pushed a commit to ibrasho-forks/dep that referenced this issue May 10, 2017
* TestCopyDir: add subdirectory to the test case; extend test to handle
  multiple files in different directories.

* Add tests for error conditions in CopyDir: source directory cannot be
  read; destination directory cannot be read; files cannot be read.

* Add tests for error conditions in IsRegular.

* Add tests for error conditions in IsDir.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
ibrasho pushed a commit to ibrasho-forks/dep that referenced this issue May 10, 2017
Test error conditions in Analyzer.DeriveManifestAndLock(...):

	* Manifest file does not exist

	* Manifest file cannot be read

	* Manifest file is invalid

Add test for Analyzer.Info() to make sure that changes to name or
version do not go unnoticed.

This addresses issue golang#41.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants