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

Start migrating off of Travis to GitHub Actions or CircleCI #8793

Closed
jywarren opened this issue Dec 1, 2020 · 24 comments · Fixed by #8795
Closed

Start migrating off of Travis to GitHub Actions or CircleCI #8793

jywarren opened this issue Dec 1, 2020 · 24 comments · Fixed by #8795

Comments

@jywarren
Copy link
Member

jywarren commented Dec 1, 2020

In-depth discussion here: https://www.jeffgeerling.com/blog/2020/travis-cis-new-pricing-plan-threw-wrench-my-open-source-works

I'm going to try opening a PR using an alternative... i think the parallel jobs may be tough!

https://circleci.com/docs/2.0/migrating-from-travis/#section=getting-started - Organizations on our free plan get 400,000 credits per month for open source builds.

https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/migrating-from-travis-ci-to-github-actions

@jywarren
Copy link
Member Author

jywarren commented Dec 1, 2020

@jywarren
Copy link
Member Author

jywarren commented Dec 1, 2020

@jywarren
Copy link
Member Author

jywarren commented Dec 1, 2020

@jywarren
Copy link
Member Author

jywarren commented Dec 1, 2020

@jywarren
Copy link
Member Author

jywarren commented Dec 1, 2020

DB connection issues... over socket... ok, following this now: mirromutth/mysql-action#2

Mysql2::Error::ConnectionError: Can't connect to MySQL server on '127.0.0.1' (111)

@jywarren
Copy link
Member Author

jywarren commented Dec 1, 2020

@jywarren
Copy link
Member Author

jywarren commented Dec 1, 2020

Looking at this first, then will try the above: https://github.community/t/github-actions-cant-connect-to-mysql/17885/2

@jywarren
Copy link
Member Author

jywarren commented Dec 1, 2020

Yes!! Mysql2::Error::ConnectionError: Access denied for user 'root'@'localhost' (using password: YES)

@jywarren
Copy link
Member Author

jywarren commented Dec 1, 2020

:-/// now i can't get back to that 'access denied' state, unfortunately. I'm now seeing:

Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.

@jywarren
Copy link
Member Author

jywarren commented Dec 2, 2020

OK, now ditching MariaDB we have gotten to running unit tests! Some cleanup to do, then very probably work on the system tests and chromedriver/screenshotting?

https://github.com/publiclab/plots2/runs/1488071276?check_suite_focus=true

We're also now seeing the MySQL 5.7 errors so we'd have to upgrade or adapt, or move back to MariaDB: #8251 #8177 #3120

Minitest::UnexpectedError:         ActiveRecord::StatementInvalid: Mysql2::Error: Expression #1 of ORDER BY clause is not in SELECT list, references column 'plots.node_revisions.timestamp' which is not in SELECT list; this is incompatible with DISTINCT: SELECT DISTINCT `node`.`nid` FROM `node` LEFT OUTER JOIN `node_revisions` ON `node_revisions`.`nid` = `node`.`nid` LEFT OUTER JOIN `community_tags` ON `community_tags`.`nid` = `node`.`nid` LEFT OUTER JOIN `term_data` ON `term_data`.`tid` = `community_tags`.`tid` WHERE (`node`.`nid`) IN (1, 8, 1, 2, 5, 8, 9, 10, 15) AND (node.status = 1) AND `node`.`type` = 'page' AND ((created >= 1606926010 AND created <= 1606933210)) ORDER BY node_revisions.timestamp DESC

@jywarren
Copy link
Member Author

jywarren commented Dec 3, 2020

ERROR["test_tag_show", #<Minitest::Reporters::Suite:0x00005632abd53f20 @name="TagControllerTest">, 79.24153970600003]
test_tag_show#TagControllerTest (79.24s)
Minitest::UnexpectedError: ActionView::Template::Error: couldn't find file 'jquery-lazyload/jquery.lazyload.js' with type 'application/javascript'

@jywarren
Copy link
Member Author

jywarren commented Dec 3, 2020

FAIL["test_that_pinned_notes_with_"pinned:foo"tags_appear_at_the_top_of[nodes:foo]inline_tables", #<Minitest::Reporters::Suite:0x000055e98b024160 @name="NodeSharedTest">, 3.0618341420000093]
test_that_pinned_notes_with
"pinned:foo"tags_appear_at_the_top_of[nodes:foo]_inline_tables#NodeSharedTest (3.06s)
Expected: 1
Actual: 0
test/unit/node_shared_test.rb:24:in `block in class:NodeSharedTest'

======================================|

@jywarren
Copy link
Member Author

jywarren commented Dec 3, 2020

that's an odd one to fail...

@jywarren
Copy link
Member Author

jywarren commented Dec 3, 2020

Later maybe we can skip Google Cloud Storage for screenshots and instead use artifacts: https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/downloading-workflow-artifacts

@jywarren
Copy link
Member Author

jywarren commented Dec 3, 2020

OK, doing well here... now need Redis?

========ERROR["test_test_digest_emails_to_moderators", #<Minitest::Reporters::Suite:0x000055b1f2f23718 @name="AdminControllerTest">, 111.284948482]
 test_test_digest_emails_to_moderators#AdminControllerTest (111.28s)
Minitest::UnexpectedError:         Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)
            app/controllers/admin_controller.rb:403:in `test_digest_email_spam'
            test/functional/admin_controller_test.rb:644:in `block in <class:AdminControllerTest>'

@jywarren
Copy link
Member Author

jywarren commented Dec 4, 2020

Looks like we have an intermittent unit test failure here:

FAIL["test_that_pinned_notes_with_\"pinned:foo\"_tags_appear_at_the_top_of_[nodes:foo]_inline_tables", #<Minitest::Reporters::Suite:0x0000560509a43738 @name="NodeSharedTest">, 3.0215084440000055]
 test_that_pinned_notes_with_"pinned:foo"_tags_appear_at_the_top_of_[nodes:foo]_inline_tables#NodeSharedTest (3.02s)
        Expected: 1
          Actual: 0
        test/unit/node_shared_test.rb:24:in `block in <class:NodeSharedTest>'

@jywarren
Copy link
Member Author

jywarren commented Dec 4, 2020

Redis is installed now, testing the connection...

@jywarren
Copy link
Member Author

jywarren commented Dec 5, 2020

Huh, after a couple restarts to get past the intermittent unit test failure, I see a functional test that is also related to tags, but otherwise not sure it's related?

===== FAIL["test_shows_suggested_tags", #<Minitest::Reporters::Suite:0x0000564c859b5ed8 @name="TagControllerTest">, 107.26565265700003]
 test_shows_suggested_tags#TagControllerTest (107.27s)
        --- expected
        +++ actual
        @@ -1 +1 @@
        -["question:spectrometer", "spectrometer", "activity:spectrometer", "activities:spectrometer"]
        +["spectrometer", "activity:spectrometer", "question:spectrometer", "activities:spectrometer"]
        test/functional/tag_controller_test.rb:525:in `block in <class:TagControllerTest>'

=====|

@jywarren
Copy link
Member Author

jywarren commented Dec 8, 2020

That's an ordering issue. I'll sort both arrays to fix.

@jywarren
Copy link
Member Author

jywarren commented Dec 8, 2020

We need to address the unit test failure above, it's intermittent but pretty common- last line of this test:

test 'that pinned notes with "pinned:foo" tags appear at the top of [nodes:foo] inline tables' do
before = "Here are some nodes in a table: \n\n[nodes:test] \n\nThis is how you make it work:\n\n`[nodes:tagname]`\n\n `[nodes:tagname]`\n\nMake sense?"
nodes(:one).add_tag('pinned:test', User.first)
nodes(:one).add_tag('test', User.first) # ensure it would appear anyways (although we aren't yet asserting order below, we should)
html = NodeShared.nodes_grid(before)
assert html
assert_equal 1, html.scan('<table class="table inline-grid nodes-grid nodes-grid-test nodes-grid-test-').length
assert_equal 1, html.scan('<table').length
assert_equal 5, html.scan('nodes-grid-test').length
assert_equal 2, html.scan('<td class="author">').length # but not 3 because it shouldn't appear twice
assert_equal 1, html.scan(nodes(:one).title).length
end

But, when we pass it, we now get to system tests!!!! Many of those fail with:

[Screenshot]: tmp/screenshots/failures_test_check_markdown_editor_features_are_functional.png
ERROR["test_check_markdown_editor_features_are_functional", #<Minitest::Reporters::Suite:0x000056450afaa280 @name="EditorTest">, 36.120224490000055]
 test_check_markdown_editor_features_are_functional#EditorTest (36.12s)
Minitest::UnexpectedError:         Capybara::ElementNotFound: Unable to find css "a[data-original-title='Edit this wiki page.']"
            test/editor_test.rb:65:in `block in <class:EditorTest>'

That's an odd one actually, the editor_test.rb is just in the /test/ directory, not in /test/system/...

find("a[data-original-title='Edit this wiki page.']").click()

Could they relate to port # of capybara/puma?:

Progress: |====Capybara starting Puma...
* Version 5.0.4 , codename: Spoony Bard
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:40915

@jywarren
Copy link
Member Author

jywarren commented Dec 8, 2020

Wow actually just 4 CSS errors like above, which could be... timing? Not sure...

then here are the remainder of the system tests, which seem odd; a couple "wrong # of arguments" and then the rest to do with ActionCable setup: No messages sent with...

UPDATE: oh, these are actually all integration tests! Hm!


=ERROR["test_should_choose_i18n_for_tag/show", #<Minitest::Reporters::Suite:0x000056450d2e45c0 @name="I18nTest">, 281.74293433899993]
 test_should_choose_i18n_for_tag/show#I18nTest (281.74s)
Minitest::UnexpectedError:         ArgumentError: wrong number of arguments (given 3, expected 1)
            test/integration/I18n_test.rb:436:in `block (2 levels) in <class:I18nTest>'
            test/integration/I18n_test.rb:431:in `each'
            test/integration/I18n_test.rb:431:in `block in <class:I18nTest>'

=ERROR["test_should_choose_i18n_for_wiki/show", #<Minitest::Reporters::Suite:0x00005645079f43c0 @name="I18nTest">, 342.8501216760001]
 test_should_choose_i18n_for_wiki/show#I18nTest (342.85s)
Minitest::UnexpectedError:         ArgumentError: wrong number of arguments (given 3, expected 1)
            test/integration/I18n_test.rb:360:in `block (2 levels) in <class:I18nTest>'
            test/integration/I18n_test.rb:355:in `each'
            test/integration/I18n_test.rb:355:in `block in <class:I18nTest>'

== FAIL["test_broadcast_only_to_users_with_notification_all_tag", #<Minitest::Reporters::Suite:0x000056450b400488 @name="CommentNotificationTest">, 350.34594951200006]
 test_broadcast_only_to_users_with_notification_all_tag#CommentNotificationTest (350.35s)
        No messages sent with {:notification=>{:title=>"New Comment on This is purple-air with hyphen", :path=>"/notes/admin/02-20-2019/purple-air-with-hyphen", :option=>{:body=>"Hey, @naman18996, @jeffrey and @jeff. This is Action Cable Integration Test", :icon=>"https://publiclab.org/logo.png"}}} to users:notification:13
        test/action_cable/integration/comment_notification_test.rb:203:in `test_broadcast_only_to_users_with_notification_all_tag'

 FAIL["test_broadcasts_when_user_is_loggedin", #<Minitest::Reporters::Suite:0x000056450c7eb998 @name="CommentNotificationTest">, 350.51518765900005]
 test_broadcasts_when_user_is_loggedin#CommentNotificationTest (350.52s)
        No messages sent with {:notification=>{:title=>"New Comment on This is purple-air with hyphen", :path=>"/notes/admin/02-20-2019/purple-air-with-hyphen", :option=>{:body=>"Hey, @naman18996 and @jeffrey. This is Action Cable Integration Test", :icon=>"https://publiclab.org/logo.png"}}} to users:notification:13
        test/action_cable/integration/comment_notification_test.rb:98:in `test_broadcasts_when_user_is_loggedin'

 FAIL["test_no_broadcast_to_non_engaged_user", #<Minitest::Reporters::Suite:0x000056450dacc198 @name="CommentNotificationTest">, 350.6792251019999]
 test_no_broadcast_to_non_engaged_user#CommentNotificationTest (350.68s)
        No messages sent with {:notification=>{:title=>"New Comment on This is purple-air with hyphen", :path=>"/notes/admin/02-20-2019/purple-air-with-hyphen", :option=>{:body=>"Hey, @naman18996 and @jeffrey. This is Action Cable Integration Test", :icon=>"https://publiclab.org/logo.png"}}} to users:notification:13
        test/action_cable/integration/comment_notification_test.rb:156:in `test_no_broadcast_to_non_engaged_user'

 FAIL["test_number_of_broadcasts_when_user_is_loggedin", #<Minitest::Reporters::Suite:0x000056450eb8a4d0 @name="CommentNotificationTest">, 350.92500581600007]
 test_number_of_broadcasts_when_user_is_loggedin#CommentNotificationTest (350.93s)
        No messages sent with {:notification=>{:title=>"New Comment on This is purple-air with hyphen", :path=>"/notes/admin/02-20-2019/purple-air-with-hyphen", :option=>{:body=>"Hey, @naman18996 and @jeffrey. This is Action Cable Integration Test", :icon=>"https://publiclab.org/logo.png"}}} to users:notification:13
        test/action_cable/integration/comment_notification_test.rb:128:in `test_number_of_broadcasts_when_user_is_loggedin'

@jywarren
Copy link
Member Author

jywarren commented Dec 9, 2020

OK, tried to add redis port to config/cable.yml

@jywarren
Copy link
Member Author

jywarren commented Dec 9, 2020

Going to try a stricter usage of chromedriver as in:

    - uses: nanasess/setup-chromedriver@v1.0.1

per https://github.com/marketplace/actions/setup-chromedriver?version=v1.0.1

@jywarren
Copy link
Member Author

jywarren commented Dec 9, 2020

OK, moving into the PR for the remaining issues, to start a little cleaner. Thanks!

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 a pull request may close this issue.

1 participant