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

Collection #3

Merged
merged 15 commits into from
Jul 15, 2014
Merged

Collection #3

merged 15 commits into from
Jul 15, 2014

Conversation

craineum
Copy link
Collaborator

This should be everything for the collection request, including documentation.

@jemiahlee
Copy link
Owner

Ok, thanks for splitting these up! I'll take a look hopefully tonight, but it may take me until the weekend to get to it. End of the quarter at work, so I have features that I need to push by Monday. :-)


### Working with Results

Each api method has it's own data structure, although there is some
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no apostrophe in this its.

@jemiahlee
Copy link
Owner

Actually, I'm gonna go through the documentation myself anyway, so don't sweat the docs right now. I'm also an attorney, so I'm big on being specific about language. :-)

One thing that I want to at least talk about is the fact that you've embedded the XML in the testing structure, which makes it very difficult to verify that we are parsing the correct data. With external files that have been generated by hitting the endpoint, we can write a separate test (though I hadn't yet done so) to validate that all of the output from the BGG API hasn't changed format (and frankly, it's not a super consistent API, so the possibility of that getting effed up seems relatively high to me). What are your thoughts on that?

@craineum
Copy link
Collaborator Author

I am absolutely horrible with english, which is sad since it is my native language. So I will not take it hard if you want to completely change things.

I agree that the BGG XML API is not consistent (date has been handle three different ways so far... grrr). The reason I pulled the xml files out, and put them into the tests is for a few reasons:

  1. It was confusing to flip between the included files and the test to figure things out. This allows for more isolation without confusion (in my mind at least).
  2. The files were huge and greatly slowed down the tests. While stress tests are great, I don't think unit testing is the place for it.
  3. I doubt the BGG API will change since they do seem to be doing versioning so far.
  4. If the BGG XML API does change then we will have to change the code anyways.

Look at it this way, our code is written to certain expectations, if those expectations change then the code has to change. The unit tests are testing those expectations, so those would also need to change.

I like your idea of testing the BGG XML API, but to make that worthwhile we would need to be running that on a continual situation. To me that is a separate app to test our expectations.

with my two cents said, I am open to discussing it further ;)

@jemiahlee
Copy link
Owner

Well, I wouldn't call any of this stress testing; more like "we handle the fact that the XML returned from the API isn't pretty." I would be way more comfortable if we had basic validation that the API works on real data, and then testing the fields from the embedded XML as you've done.

@craineum
Copy link
Collaborator Author

craineum commented Jul 2, 2014

So more of an integration test. I could generate a full set of data (maxed out fields and request) that has a couple of records. Then verify all the calls do not contain nil. This should test everything without having to worry about what is being matched, as that is being handled by the unit tests.

This way we could always generate a new set of data off the API and verify none of our expectations has changed.

That sound good?

@jemiahlee
Copy link
Owner

Yeah, I think that would be fine.

@craineum
Copy link
Collaborator Author

craineum commented Jul 7, 2014

Ok, merged in master and added sample data for collection.

If this is good and you merge, will then go and merge into my other pull request for "search" as I am sure there will be merge conflicts.

@jemiahlee
Copy link
Owner

Ok, apologies for the delay. Looking at this right now.

@jemiahlee
Copy link
Owner

Ok, so the only thing that's weird to me is that you have a merge commit in this PR. There really shouldn't be merge commits. The PRs should be the only thing creating merge commits. Github doesn't show this as having made any modifications for the merge commit, so I'll merge it, but please use rebase in the future. That should minimize the codebase turbulence and also make it easier for you to combine your new commits.

jemiahlee added a commit that referenced this pull request Jul 15, 2014
Rework the Collection infrastructure.
@jemiahlee jemiahlee merged commit e3db9fc into jemiahlee:master Jul 15, 2014
@craineum
Copy link
Collaborator Author

I will have to learn how to use rebase for that :) This is my first time contributing to a forked item. Have always worked in primary repository. Thanks!

@jemiahlee
Copy link
Owner

Yeah, 99.9999% of the time, you want to use rebase.

@jemiahlee
Copy link
Owner

Also, my comment there really even applies for when you're working on a single repository that isn't a fork. rebase is always the better operation (because it never rewrites/changes the old sequence of commits in any way).

@craineum
Copy link
Collaborator Author

I almost always do a git pull --rebase, which I think is the same?

@jemiahlee
Copy link
Owner

Well, git pull is a compound command, consisting of a fetch and then a merge (the default) or a rebase (the way you've used it there). So yeah, that should basically always be ok, as long as the branch name is the same on origin as the one you're on.

@craineum craineum deleted the collection branch October 23, 2014 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants