Skip to content

Integtest: Add tests for building all books #810

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

Merged
merged 5 commits into from
Apr 19, 2019

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Apr 11, 2019

Adds a basic test for building all books. I expect we'll want to refactor
it significantly as we port more tests for Make to rspec, but this is a
start!

Adds a basic test for building all books. I expect we'll want to refactor
it significantly as we port more tests for Make to rspec, but this is a
start!
@nik9000 nik9000 requested a review from estolfo April 11, 2019 21:39
Some text.
ASCIIDOC
src.init_repo 'source'
src.write 'conf.yaml', <<~YAML
Copy link
Member Author

Choose a reason for hiding this comment

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

I think I'll end up having to make generating this file more parameterized and automatic but I'd like to wait for a follow up for that.

@@ -15,18 +15,6 @@ def sh(cmd)
out
end

##
# Init a git repo in root and commit any files in it.
def init_repo(root)
Copy link
Member Author

Choose a reason for hiding this comment

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

I've moved this to the Source object because we'll want to initialize many repos when testing --all

dest_file(file_name)
end
let(:contents) do
return unless File.exist? file
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks strange to me to have a return in a let block. Maybe you can just write the line in a if File.exist? file

Copy link
Member Author

Choose a reason for hiding this comment

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

It does feel weird? I'm not really sure the if File.exist? block is super clear either. I think for me coming from Java the return unless is more clear but I can't speak to idiomatic ruby.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess I think of let blocks not quite as methods, more like procs. But this is not a critical thing and if you prefer using return, that's no problem.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks!

Let me see if I can resolve the merge conflicts here.....

Copy link
Member Author

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

@estolfo, could you have another look at this one when you get a chance? Merging master required I do a little reorganization!

@nik9000 nik9000 merged commit 15bf3c0 into elastic:master Apr 19, 2019
@nik9000
Copy link
Member Author

nik9000 commented Apr 19, 2019

Thanks for reviewing @estolfo! This is a big help!

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