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

Backfill tests #4

Closed
8 tasks done
jchesterpivotal opened this issue Aug 18, 2018 · 0 comments
Closed
8 tasks done

Backfill tests #4

jchesterpivotal opened this issue Aug 18, 2018 · 0 comments

Comments

@jchesterpivotal
Copy link
Owner

jchesterpivotal commented Aug 18, 2018

As a Pivot
I want to have tested code
So that I may be received in polite company

Given a codebase which is untested
When I backfill the tests
Then I should feel less guilty

  • build-pass-fail
  • prettyjson wrapper commands (show-build, show-plan, show-resources)
  • prettyjson
  • show-logs
  • check cmd
  • check pkg
  • in cmd
  • in pkg
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
- Introduce sclevine/spec library

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
- Use tabs for fixture indentation

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
Previously relied on a build/build.json file which was shared amongst
tests -- a fragile approach that couldn't be parallelised safely.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
The spec library has a different operation model from Ginkgo. For
one-time before/afters, the logic must sit outside of the spec.Run()
method, not under a it.Before/it.After.

Shows a dramatic speedup, as we are no longer unwittingly recompiling
the command for every single test.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
Prefactoring in anticipation of shifting logic around.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
This is ugly and makes me sad and worried that I have overlooked
something obvious or fundamentally misunderstood something.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
Using a shared test, as these commands are almost identical.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
A better solution will be only allowing a single directory level and
hardcoding the file names, since the resource generates them. But
this commit at least provides a catch-all integration test.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
Intended to make traversal attacks harder.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 18, 2018
Intended to make traversal attacks harder.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
- Add directory traversal guard logic

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
Copying and pasting is hilarious.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
- Fix misleading error message (said 'in', should've been 'check')

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
A prefactoring to help testing pkg/check.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
Another prefactoring to support test.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
- Fixed some bugs
  - Fixed for empty responses
  - Fixed for responses with no new versions
- Some changes to wording
- Add counterfeiter-generated fakes for go-concourse. Due to a known
  bug, I had to edit these manually to use a non-vendor import path
  in the generated code. See: maxbrunsfeld/counterfeiter#75

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
Prefactoring to support testing. Same pattern as with pkg/check.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
As with pkg/check, there are a few changes.

- Fixed trying to read error message from nil errors on 404s
- Some changes to wording
- Added counterfeiter-generated fakes for eventstream. Due to a known
  bug, I had to manually edit the fake file to use a non-vendor import
  path in the generated code. This also arose in bbc3538.
  See: See: maxbrunsfeld/counterfeiter#75

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
jchesterpivotal pushed a commit that referenced this issue Aug 19, 2018
[Finishes #4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
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

No branches or pull requests

1 participant