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

[System Tests] Consolidate Comment Tests for Wikis, Questions, and Notes #8860

Merged
merged 9 commits into from
Dec 17, 2020

Conversation

noi5e
Copy link
Contributor

@noi5e noi5e commented Dec 16, 2020

Instead of continuing to write distinct comment tests for wikis, questions, notes, etc. I decided to consolidate them.

The basic format of comment_test.rb is now:

page_types.each do |page_type, node_name|
    page_type_string = page_type.to_s

    test "#{page_type_string}: test title" do
        # do something
        # make assertion
    end
end

NOTES:

  • Can you review test_helper.rb, and make sure that I'm implementing this block correctly?
  • I went ahead and and put all 14 tests into the loop, which increases the # of tests to 42. (14 tests * 3 page types)
    • I can easily scale this back for comfort's sake, just let me know!
  • I ran the tests locally and the runtime doesn't seem to have slowed down at all.
  • The tests look fine, so I believe this is ready to merge.

(This PR is part of the larger Comment Editor Overhaul Project with Outreachy. Refer to Planning Issue #9069 for more context)

@noi5e noi5e added testing issues are usually for adding unit tests, integration tests or any other tests for a feature outreachy labels Dec 16, 2020
@gitpod-io
Copy link

gitpod-io bot commented Dec 16, 2020

@noi5e
Copy link
Contributor Author

noi5e commented Dec 16, 2020

Rebased to match the new and improved master!

@jywarren
Copy link
Member

Hmm, it seems stalled? I'll try restarting it. Thanks!

@jywarren jywarren closed this Dec 16, 2020
@jywarren jywarren reopened this Dec 16, 2020
@gitpod-io
Copy link

gitpod-io bot commented Dec 16, 2020

@jywarren
Copy link
Member

Hmm... That's odd. If it doesn't start soon, could you try a manual rebase with git rebase... instead of the merge? Maybe that'll trigger it. Sorry, thought it'd be more straightforward!

@jywarren
Copy link
Member

OK, we modified the trigger to be for pull_request instead and hopefully it'll trigger properly now given one more rebase. My apologies for getting that trigger wrong!

@codecov
Copy link

codecov bot commented Dec 17, 2020

Codecov Report

❗ No coverage uploaded for pull request base (main@98c561e). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8860   +/-   ##
=======================================
  Coverage        ?   81.86%           
=======================================
  Files           ?      100           
  Lines           ?     5938           
  Branches        ?        0           
=======================================
  Hits            ?     4861           
  Misses          ?     1077           
  Partials        ?        0           

@codeclimate
Copy link

codeclimate bot commented Dec 17, 2020

Code Climate has analyzed commit a2bd219 and detected 0 issues on this pull request.

View more on Code Climate.

@jywarren
Copy link
Member

I think this is unrelated to our code, but it's probably worth opening a new issue for it and trying to search for this issue in relation to github actions, or maybe in the mysql github action:

/home/runner/work/plots2/plots2/vendor/bundle/ruby/2.6.0/gems/ffi-1.13.1/lib/ffi/library.rb:112: [BUG] Illegal instruction at 0x00007fb387d3a6d0
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0057 p:---- s:0287 e:000286 CFUNC  :open
c:0056 p:0022 s:0281 e:000280 BLOCK  /home/runner/work/plots2/plots2/vendor/bundle/ruby/2.6.0/gems/ffi-1.13.1/lib/ffi/library.rb:112 [FINISH]
c:0055 p:---- s:0272 e:000271 CFUNC  :each
c:0054 p:0113 s:0268 e:000267 BLOCK  /home/runner/work/plots2/plots2/vendor/bundle/ruby/2.6.0/gems/ffi-1.13.1/lib/ffi/library.rb:109 [FINISH]

in the meantime i restarted!

@jywarren
Copy link
Member

Looks great!!

Copy link
Member

@jywarren jywarren left a comment

Choose a reason for hiding this comment

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

Looks awesome. I'll merge it now!!!


comment_response_text = 'wooly woot'

test "#{page_type_string}: addComment(comment_text)" do
Copy link
Member

Choose a reason for hiding this comment

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

huh cool! I didn't know you could nest test blocks under a loop, but that makes sense as long as the names are unique! Great work!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! 🎈 Creative solution, but it seems to work!

@jywarren jywarren merged commit 8ea3e49 into publiclab:main Dec 17, 2020
@jywarren
Copy link
Member

Awesome! So great to see everything pass here! Thanks @noi5e !!!! 👍 🎉

@noi5e noi5e deleted the test/consolidate-comment-tests branch December 17, 2020 21:53
@noi5e noi5e changed the title Consolidate Comment Tests for Wikis, Questions, and Notes Testing: Consolidate Comment Tests for Wikis, Questions, and Notes Dec 27, 2020
@noi5e noi5e changed the title Testing: Consolidate Comment Tests for Wikis, Questions, and Notes [System Tests] Consolidate Comment Tests for Wikis, Questions, and Notes Jan 23, 2021
manchere pushed a commit to manchere/plots2 that referenced this pull request Feb 13, 2021
…8860)

* change :question4 to :comment_question

* consolidate all comment tests

* add helper function to retrieve fixture names

* change :question4 to :comment_question

* consolidate all comment tests

* add helper function to retrieve fixture names
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
…8860)

* change :question4 to :comment_question

* consolidate all comment tests

* add helper function to retrieve fixture names

* change :question4 to :comment_question

* consolidate all comment tests

* add helper function to retrieve fixture names
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
…8860)

* change :question4 to :comment_question

* consolidate all comment tests

* add helper function to retrieve fixture names

* change :question4 to :comment_question

* consolidate all comment tests

* add helper function to retrieve fixture names
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
…8860)

* change :question4 to :comment_question

* consolidate all comment tests

* add helper function to retrieve fixture names

* change :question4 to :comment_question

* consolidate all comment tests

* add helper function to retrieve fixture names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
outreachy testing issues are usually for adding unit tests, integration tests or any other tests for a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants