dreverri / gollum-site

Static Site Generator for Gollum Wikis
254 stars 28 forks source link

Depend on gollum-lib instead of gollum #30

Closed jingoro closed 11 years ago

jingoro commented 11 years ago

Recent changes in gollum have introduced the new gollum-lib gem. This patch changes the dependencies accordingly.

mpemer commented 11 years ago

Tests fail after merge. Some of the dem dependencies are left open ended and granted, they were first created a long time ago. I would not be surprised if one or more of the gem dependencies would need to be pegged to older versions, because their usage have become obsolete.

(0) gollum-site [master]$ rake test /Users/mpemer/.rvm/rubies/ruby-1.9.3-p385/bin/ruby -I"lib:lib:test:." -I"/Users/mpemer/.rvm/gems/ruby-1.9.3-p385@global/gems/rake-10.0.3/lib" "/Users/mpemer/.rvm/gems/ruby-1.9.3-p385@global/gems/rake-10.0.3/lib/rake/rake_testloader.rb" "test/*/test__.rb" Run options:

# Running tests:

.....F.F.FFFF

Finished tests in 0.502865s, 25.8519 tests/s, 27.8405 assertions/s.

  1) Failure:
test_Footer_is_rendered_in__Layout(#<Class:0x007fb5cb3bd750>) [/Users/mpemer/src/gollum-site/test/test_site.rb:180]:
<"<p>hello</p>\n"> expected but was
<"Liquid error: can't convert nil into String\n">.

  2) Failure:
test_Sidebar_is_rendered_in__Layout(#<Class:0x007fb5cb3bd750>) [/Users/mpemer/src/gollum-site/test/test_site.rb:185]:
<"<p>world</p>\n"> expected but was
<"Liquid error: can't convert nil into String\n">.

  3) Failure:
test_page_path_is_available_on_template(#<Class:0x007fb5cb3daf30>) [/Users/mpemer/src/gollum-site/test/test_site.rb:46]:
<["<ul><li>page.html</li></ul>\n"]> expected but was
<["<ul><li>Liquid error: can't convert nil into String</li></ul>\n"]>.

  4) Failure:
test_render_page_with_layout_and_link(#<Class:0x007fb5cb3daf30>) [/Users/mpemer/src/gollum-site/test/test_site.rb:30]:
<["<html><p>Site test\n",
 "<a class=\"internal present\" href=\"/Page1.html#test\">Page1#test</a>\n",
 "<a class=\"internal present\" href=\"/Page-One.html#test\">Page with anchor</a></p></html>\n"]> expected but was
<["<html>Liquid error: can't convert nil into String</html>\n"]>.

  5) Failure:
test_render_page_with_layout_from_parent_dir(#<Class:0x007fb5cb3daf30>) [/Users/mpemer/src/gollum-site/test/test_site.rb:36]:
<["<html><p>Site test</p></html>\n"]> expected but was
<["<html>Liquid error: can't convert nil into String</html>\n"]>.

  6) Failure:
test_render_page_with_layout_from_sub_dir(#<Class:0x007fb5cb3daf30>) [/Users/mpemer/src/gollum-site/test/test_site.rb:41]:
<["<html><body><p>Site test</p></body></html>\n"]> expected but was
<["<html><body>Liquid error: can't convert nil into String</body></html>\n"]>.

13 tests, 14 assertions, 6 failures, 0 errors, 0 skips
rake aborted!
Command failed with status (6): [ruby -I"lib:lib:test:." -I"/Users/mpemer/.rvm/gems/ruby-1.9.3-p385@global/gems/rake-10.0.3/lib" "/Users/mpemer/.rvm/gems/ruby-1.9.3-p385@global/gems/rake-10.0.3/lib/rake/rake_test_loader.rb" "test/**/test_*.rb" ]
/Users/mpemer/.rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `eval'
/Users/mpemer/.rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => test
(See full trace by running task with --trace)
mpemer commented 11 years ago

I suspect one of these libraries is causing the dependency issue, where usage of a library has become obsolete:

grit-2.5.0
stringex-1.5.1
gollum-lib-1.0.0

They were the only updates in my system from before merging the pull request, running "gem install gollum-lib" and then a "rake test" again. @jingoro - please see if you can reproduce the test failures in your environment.

jingoro commented 11 years ago

I just cloned and ran the tests on the the upstream master (de5460b4a1f25b3eee69b70722ab4cee428a015d) and this was the result of running rake test:

# Running tests:

.F.FFF.F..FFF

Finished tests in 1.522385s, 8.5392 tests/s, 9.1961 assertions/s.

  1) Failure:
test_working_site_Home_html_content_is_uncommitted_version(#<Class:0x007f8d833555f8>) [/Users/jingoro/work/gollum-site/test/test_site.rb:81]:
<"<p>Hello World\nHello World</p>"> expected but was
<"<p>Hello World\nHello World</p>\n">.

  2) Failure:
test_embed_with_src(#<Class:0x007f8d8335aeb8>) [/Users/jingoro/work/gollum-site/test/test_site.rb:152]:
<"<p><embed src=\"foo.html\"></embed></p>"> expected but was
<"<p><embed src=\"foo.html\"></embed></p>\n">.

  3) Failure:
test_link_with_irc_protocol(#<Class:0x007f8d8335aeb8>) [/Users/jingoro/work/gollum-site/test/test_site.rb:147]:
<"<p><a href=\"irc://irc.freenode.net/foo\">Hello World</a></p>"> expected but was
<"<p><a href=\"irc://irc.freenode.net/foo\">Hello World</a></p>\n">.

  4) Failure:
test_Footer_is_rendered_in__Layout(#<Class:0x007f8d83359a40>) [/Users/jingoro/work/gollum-site/test/test_site.rb:180]:
<"<p>hello</p>\n"> expected but was
<"<p>hello</p>\n\n">.

  5) Failure:
test_Sidebar_is_rendered_in__Layout(#<Class:0x007f8d83359a40>) [/Users/jingoro/work/gollum-site/test/test_site.rb:185]:
<"<p>world</p>\n"> expected but was
<"<p>world</p>\n\n">.

  6) Failure:
test_render_page_with_layout_and_link(#<Class:0x007f8d83357830>) [/Users/jingoro/work/gollum-site/test/test_site.rb:30]:
<["<html><p>Site test\n",
 "<a class=\"internal present\" href=\"/Page1.html#test\">Page1#test</a>\n",
 "<a class=\"internal present\" href=\"/Page-One.html#test\">Page with anchor</a></p></html>\n"]> expected but was
<["<html><p>Site test\n",
 "<a class=\"internal present\" href=\"/Page1.html#test\">Page1#test</a>\n",
 "<a class=\"internal present\" href=\"/Page-One.html#test\">Page with anchor</a></p>\n",
 "</html>\n"]>.

  7) Failure:
test_render_page_with_layout_from_parent_dir(#<Class:0x007f8d83357830>) [/Users/jingoro/work/gollum-site/test/test_site.rb:36]:
<["<html><p>Site test</p></html>\n"]> expected but was
<["<html><p>Site test</p>\n", "</html>\n"]>.

  8) Failure:
test_render_page_with_layout_from_sub_dir(#<Class:0x007f8d83357830>) [/Users/jingoro/work/gollum-site/test/test_site.rb:41]:
<["<html><body><p>Site test</p></body></html>\n"]> expected but was
<["<html><body><p>Site test</p>\n", "</body></html>\n"]>.

13 tests, 14 assertions, 8 failures, 0 errors, 0 skips
rake aborted!

This looks like a different set of errors. Is there are a particular revision in the upstream master where the all the tests pass so I can reference it?

dreverri commented 11 years ago

Odd... we all seem to be getting different results. The tests all pass for me on the latest master.

OS X 10.7.5 ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.3.0]

$ bundle install --path vendor/bundle
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Installing rake (10.0.3)
Installing blankslate (2.1.2.4)
Installing diff-lcs (1.1.3)
Installing directory_watcher (1.4.1)
Installing ffi (1.0.11) with native extensions
Installing github-markdown (0.3.2) with native extensions
Installing github-markup (0.7.2)
Installing mime-types (1.18)
Installing grit (2.4.1)
Installing mustache (0.99.4)
Installing nokogiri (1.5.2) with native extensions
Installing posix-spawn (0.3.6) with native extensions
Installing rubypython (0.5.3)
Installing pygments.rb (0.2.12)
Installing sanitize (2.0.3)
Installing rack (1.4.1)
Installing rack-protection (1.2.0)
Installing tilt (1.3.3)
Installing sinatra (1.3.2)
Installing gollum (1.4.3)
Installing liquid (2.3.0)
Installing mixlib-log (1.3.0)
Using gollum-site (0.1.12) from source at .
Using bundler (1.2.1)

$ bundle exec rake test
/Users/dreverri/.rbenv/versions/1.9.2-p290/bin/ruby -I"lib:lib:test:." -I"/Users/dreverri/src/basho/gollum-site/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib" "/Users/dreverri/src/basho/gollum-site/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/rake_test_loader.rb" "test/**/test_*.rb"
Loaded suite /Users/dreverri/src/basho/gollum-site/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/rake_test_loader
Started
.............
Finished in 0.950066 seconds.

13 tests, 14 assertions, 0 failures, 0 errors, 0 skips

Test run options: --seed 14341
dreverri commented 11 years ago

@jingoro the rendering process on your machine is adding newline characters after </p> which is unexpected. I'm not sure which gem would be doing that.

jingoro commented 11 years ago

I just tried re-running tests using an OS X ruby-1.9.2-p320 [ x86_64 ] and still got the extra newline problems. Let me try redoing this on another environment and I''l report back.

jingoro commented 11 years ago

Okay, on Ubuntu 12.04 x86-64 I got upstream master to pass all tests. When I tried running the tests with this patch, I got a different set of errors:

# Running tests:

.....E.E.EEEE

Finished tests in 0.889898s, 14.6084 tests/s, 8.9898 assertions/s.

  1) Error:
test_Footer_is_rendered_in__Layout(#<Class:0x00000002b93488>):
Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/footer.html
    /home/jingoro/me/gollum-site/test/test_site.rb:179:in `read'
    /home/jingoro/me/gollum-site/test/test_site.rb:179:in `block (2 levels) in <top (required)>'

  2) Error:
test_Sidebar_is_rendered_in__Layout(#<Class:0x00000002b93488>):
Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/sidebar.html
    /home/jingoro/me/gollum-site/test/test_site.rb:184:in `read'
    /home/jingoro/me/gollum-site/test/test_site.rb:184:in `block (2 levels) in <top (required)>'

  3) Error:
test_page_path_is_available_on_template(#<Class:0x00000002b87958>):
Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/page.html
    /home/jingoro/me/gollum-site/test/test_site.rb:46:in `initialize'
    /home/jingoro/me/gollum-site/test/test_site.rb:46:in `open'
    /home/jingoro/me/gollum-site/test/test_site.rb:46:in `block (2 levels) in <top (required)>'

  4) Error:
test_render_page_with_layout_and_link(#<Class:0x00000002b87958>):
Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/Home.html
    /home/jingoro/me/gollum-site/test/test_site.rb:31:in `initialize'
    /home/jingoro/me/gollum-site/test/test_site.rb:31:in `open'
    /home/jingoro/me/gollum-site/test/test_site.rb:31:in `block (2 levels) in <top (required)>'

  5) Error:
test_render_page_with_layout_from_parent_dir(#<Class:0x00000002b87958>):
Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/Page1.html
    /home/jingoro/me/gollum-site/test/test_site.rb:36:in `initialize'
    /home/jingoro/me/gollum-site/test/test_site.rb:36:in `open'
    /home/jingoro/me/gollum-site/test/test_site.rb:36:in `block (2 levels) in <top (required)>'

  6) Error:
test_render_page_with_layout_from_sub_dir(#<Class:0x00000002b87958>):
Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/Page2.html
    /home/jingoro/me/gollum-site/test/test_site.rb:41:in `initialize'
    /home/jingoro/me/gollum-site/test/test_site.rb:41:in `open'
    /home/jingoro/me/gollum-site/test/test_site.rb:41:in `block (2 levels) in <top (required)>'

13 tests, 8 assertions, 0 failures, 6 errors, 0 skips

Looking into briefly it seems that @site.generate() is not generating anything. It's the failing on the same tests although it's a different effect. I'll try tracing things and see what turns up.

dreverri commented 11 years ago

I received those same errors over the weekend when the tests repos were converted to bare repos. The latest commit reverted changes to the test repos. Can you make sure you're at the most recent commit? https://github.com/dreverri/gollum-site/commit/de5460b4a1f25b3eee69b70722ab4cee428a015d

Thanks, Dan

On Mon, May 20, 2013 at 2:51 PM, John Nishinaga notifications@github.comwrote:

Okay, on Ubuntu 12.04 x86-64 I got upstream master to pass all tests. When I tried running the tests with this patch, I got a different set of errors:

Running tests:

.....E.E.EEEE

Finished tests in 0.889898s, 14.6084 tests/s, 8.9898 assertions/s.

1) Error: test_Footer_is_rendered_in__Layout(#Class:0x00000002b93488): Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/footer.html /home/jingoro/me/gollum-site/test/test_site.rb:179:in read' /home/jingoro/me/gollum-site/test/test_site.rb:179:inblock (2 levels) in <top (required)>'

2) Error: test_Sidebar_is_rendered_in__Layout(#Class:0x00000002b93488): Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/sidebar.html /home/jingoro/me/gollum-site/test/test_site.rb:184:in read' /home/jingoro/me/gollum-site/test/test_site.rb:184:inblock (2 levels) in <top (required)>'

3) Error: test_page_path_is_available_on_template(#Class:0x00000002b87958): Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/page.html /home/jingoro/me/gollum-site/test/test_site.rb:46:in initialize' /home/jingoro/me/gollum-site/test/test_site.rb:46:inopen' /home/jingoro/me/gollum-site/test/test_site.rb:46:in `block (2 levels) in <top (required)>'

4) Error: test_render_page_with_layout_and_link(#Class:0x00000002b87958): Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/Home.html /home/jingoro/me/gollum-site/test/test_site.rb:31:in initialize' /home/jingoro/me/gollum-site/test/test_site.rb:31:inopen' /home/jingoro/me/gollum-site/test/test_site.rb:31:in `block (2 levels) in <top (required)>'

5) Error: test_render_page_with_layout_from_parent_dir(#Class:0x00000002b87958): Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/Page1.html /home/jingoro/me/gollum-site/test/test_site.rb:36:in initialize' /home/jingoro/me/gollum-site/test/test_site.rb:36:inopen' /home/jingoro/me/gollum-site/test/test_site.rb:36:in `block (2 levels) in <top (required)>'

6) Error: test_render_page_with_layout_from_sub_dir(#Class:0x00000002b87958): Errno::ENOENT: No such file or directory - /home/jingoro/me/gollum-site/test/./examples/site/Page2.html /home/jingoro/me/gollum-site/test/test_site.rb:41:in initialize' /home/jingoro/me/gollum-site/test/test_site.rb:41:inopen' /home/jingoro/me/gollum-site/test/test_site.rb:41:in `block (2 levels) in <top (required)>'

13 tests, 8 assertions, 0 failures, 6 errors, 0 skips

Looking into briefly it seems that @site.generate() is not generating anything. It's the failing on the same tests although it's a different effect. I'll try tracing things and see what turns up.

— Reply to this email directly or view it on GitHubhttps://github.com/dreverri/gollum-site/pull/30#issuecomment-18176407 .

jingoro commented 11 years ago

Thanks. Now the tests are failing as you described. I'll start looking into this.

jingoro commented 11 years ago

Okay I fixed the issue and the tests now pass.