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

Refreshed gem #91

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open

Refreshed gem #91

wants to merge 32 commits into from

Conversation

bitaxis
Copy link

@bitaxis bitaxis commented Oct 8, 2017

I refreshed the gem with updated dependency versions, added Rails 5.0 & 5.1 to the appraisal, and use Ruby 2.4.1 as well.

All tests and appraisals pass.

@hsgubert
Copy link
Owner

Hi @bitaxis, interesting contributions.
Is there anything you could contribute/update on the README file? Also, it seems to me the wiki page https://github.com/hsgubert/cassandra_migrations/wiki/Migrations-DSL could be updated with your new helpers.

Just for consistency with previous contributions, could you add your name to the Contributors section on the README file instead of altering the .gemspec? In case you with to do bigger contributions and take the responsability to maintain the gem on the long term I would have no problem in adding you to the authors list in the future.

@hsgubert hsgubert self-requested a review October 23, 2017 11:05
@bitaxis
Copy link
Author

bitaxis commented Nov 1, 2017

Sure. I'll take a look at the Wiki pages and add my name to the list of contributors, and make improvements, should my use of it continues. However, I am not at a place where I would want to take over the gem's maintenance.

@hsgubert
Copy link
Owner

hsgubert commented Nov 1, 2017

no problem @bitaxis . I just mentioned about gem maintenance in case you wanted to be included in the authors list. Your contribution is very welcome in any case! (and in any size)

2. Add !use_keyspace so that the migration needn't change with environments.
3. Improve !use by converting keyspace to string in case it's a symbol.
…r to work, for now.

2. Add spec for #use_keyspace.
2. Add additional keyspace environments for testing.
3. Add spec for .use_keyspace method.
4. Refine comments for the .use_keyspace method.
@bitaxis
Copy link
Author

bitaxis commented Apr 18, 2018

@hsgubert, I updated the Wiki on your repo to match version 1.2.0 of the gem on my fork.

However, I have since released version 1.3.1 of the gem on my fork, which contains functionality that does not exist in yours. Hence, I also cloned your Wiki and made changes there. Please take a look and satisfy this pull request as well as merging the Wiki changes I made back to yours.

For now the best place to put your name and contact is on the README.md file as a contributor (also to be fair with other contributors). As I said earlier, if you wish to help maintain the gem on the long term I see no problem in putting you as an author too.
Copy link
Owner

@hsgubert hsgubert left a comment

Choose a reason for hiding this comment

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

You pull request is 90% ok. I just didn't find unit tests for the new methods in migration.rb.

Also, I know you improved the wiki pages, but please, do review the README.md file to see if all instructions there still work and the versions of dependencies are still correct. I noticed you had forgotten to put yourself as a contributor there, so I am not so confident you reviewed the README.md file.

Address those issues and we can merge your commits and publish a new version of the gem.

Thank you for your help in this project.

@bitaxis
Copy link
Author

bitaxis commented Apr 19, 2018

@hsgubert, thank you for acknowledging my contributions.

I took a look at the existing specs, and I don't see tests for previously existing methods such as announce_migration, announce_operation, and announce_suboperation. If you can provde some guidance/insight on how I might test them, I'd be happy to follow along.

Also, having reviewed the README.md file, I don't think I've changed anything that would cause existing features to break.

@hsgubert
Copy link
Owner

hsgubert commented Apr 19, 2018

I see your point. I think the reason why we never were really strict about the announce_ methods is because they just print statements. But it wouldn't hurt to have tests for them as well, just to ensure no crash happens when they're called.

About the new execute_ methods you created, they have business logic in them and therefore should be tested. We just need 3 test cases:

  1. For the execute_text method, just pass a few examples of CQL text (including trailing spaces or not, semicolon or not) and check that execute is called with the expected parameter (you can use rspec-mocks for that)

  2. execute_statement: just test it delegates call to execute

  3. execute_file: stub File.read and make it return a CQL text when a certain argument is received. Then just check execute is called with the correct parameter

Something like that is enough. If you want to create tests for the announce_ methods you can too, but I'm ok with keeping them without unit tests.

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.

2 participants