Change-Id: Ifef519776e4358204dd6625acd6cd9f841cd7fcb
Reviewed-on: https://gerrit.instructure.com/152331
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
with nested specs, where the other group has :once stuff, but the
inner does not
Change-Id: I2145cba249b5cbeb82c19ef47037674ac867f44d
Reviewed-on: https://gerrit.instructure.com/159901
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
this patchset removes the unused provisional grade comments, they
weren't used! It also refactors some app code but the majority of the
work was in speed_grader_spec.rb
test plan:
this patchset removes unused code, so we could smoke test speedgrader
for submission comments with moderated grading, but honestly it seems
like overkill if the specs pass.
closes: GRADE-1311
Change-Id: I0b5d3417d3c113b4fa88542284d1e04b2a291be6
Reviewed-on: https://gerrit.instructure.com/155612
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Tested-by: Jenkins
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
* disable counter cache detection (we don't use it everywhere, because it can
be a db resource drain)
* mark objects created via spec factories that bypass AR as newly-created,
and thus not needing to have associations preloaded on them
Change-Id: Ifc39c87df753fb28f8b094d77a5afe4f90fe8809
Reviewed-on: https://gerrit.instructure.com/156646
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
copy state over from before(:once) to examples, so that objects
created in the before(:once) don't get tagged as needing to have
been preloaded
Change-Id: I3a2f4fe1b7359f62f55d61a664e6bdcc1499862e
Reviewed-on: https://gerrit.instructure.com/156632
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This also moves the pact_config.rb file into the pact folder.
The line filtering :pact tests has been removed from spec_helper.rb,
since rspec won't try to run them anyway now that they aren't in the
spec folder.
Change-Id: I1d8f27f4f30aa2cdc85e570deb7e0aa2cdb89c66
Reviewed-on: https://gerrit.instructure.com/152144
Reviewed-by: Michael Hargiss <mhargiss@instructure.com>
Tested-by: Jenkins
Product-Review: Tucker McKnight <tmcknight@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
When loading or selecting a student in SpeedGrader, an ajax call is made
to obtain the provisional grade status for that student. This provides a
way to perform this request anonymously.
closes GRADE-1128
test plan
- given an anonymously graded and moderated assignment
- given some students assigned to said assignment
- when visiting speed grader
- then the page loads provisional grades endpoint which can be viewed in
the dev tools on the network tab. The URL looks like:
/api/v1/courses/1/assignments/1/anonymous_provisional_grades/status
Change-Id: Ib3d3a7b58fc8fa044d240dee0c1bef08b80384d0
Reviewed-on: https://gerrit.instructure.com/151607
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
test plan:
- make sure that Jenkins still runs all of the usual tests
- create a Selenium test marked as i18n: true and make sure
that it gets run in the canvas__selenium-i18n build
- console output for failing tests in the i18n build
should include which language they failed in
closes CORE-1038
closes CORE-1041
Change-Id: Ie0f2797b704db4fa6aedae3792c0a75b9e83325e
Reviewed-on: https://gerrit.instructure.com/143659
Reviewed-by: Eric Jacobs <ejacobs@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Tucker McKnight <tmcknight@instructure.com>
Test Plan:
- follow the instructions in spec/contracts/README.md to run
the live events contract tests locally
- follow the instructions in
spec/contracts/service_providers/canvas_lms/README.md to run
the "Generic Consumer" Canvas API contract tests locally
Change-Id: I316747f53731f411ab82432587596e335c2fd059
Reviewed-on: https://gerrit.instructure.com/149766
Reviewed-by: Tucker McKnight <tmcknight@instructure.com>
Tested-by: Jenkins
Product-Review: Michael Hargiss <mhargiss@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Change-Id: I20d2b6f522a742d220f4263e4d53353bbd996671
Reviewed-on: https://gerrit.instructure.com/146125
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
refs QUIZ-4175
Test Plan:
- qa-cr for now. A subsequent commit will include a comprehensive
test plan once the Quiz LTI contract test is published.
Change-Id: I2ffe962d8a626994614f3cc904d131e41e3a00b1
Reviewed-on: https://gerrit.instructure.com/145857
Tested-by: Jenkins
Reviewed-by: Mark Grant <mgrant@instructure.com>
Product-Review: Michael Hargiss <mhargiss@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Change-Id: I4146172303ccd60375b829750296349f353f4ac4
Reviewed-on: https://gerrit.instructure.com/146356
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Change-Id: I67b0b7b9baa41d76a34f37e2b33541cb10760dc6
Reviewed-on: https://gerrit.instructure.com/145006
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
closes GRADE-941
test plan:
A. Setup
1. Select or create
a. A Course
b. At least one Student
c. At least one TA
d. At least one Assignment with rubric
2. Enable avatars
3. As the Student
a. Give yo'self an avatar
* Remember to smile
b. Submit to the assignment
c. Comment on the submission
4. As the TA
a. Upload an avatar
* No smiles. You are only an assistant.
b. Comment on the submission
5. As the Teacher
a. Avatar: The Last Gradebender
* Wear that nice sweater you for for your birthday
b. Grade the submission using the rubric
c. Comment on the submission
6. In the Rails console
a. Load the submission
b. Assign `abcde` as the submission `anonymous_id`
c. Save the submission
B. With AMM Enabled
1. Enable the AMM feature flag
2. Visit the course in SpeedGrader
3. Open the browser network dev tool tab
4. Refresh to ensure the `speed_grader.json` request is present
5. View the response to that request
6. Verify for the enrollments
a. The student id is absent from the student enrollment
* `context.enrollments[*].user_id`
b. The enrollment has an anonymous_id of `abcde`
* `context.enrollments[*].anonymous_id`
7. Verify for the submission
a. The submission has an anonymous_id of `abcde`
* `submissions[*].anonymous_id`
b. The submission has no `user_id`
* `submissions[*].user_id`
c. The submission history has an anonymous_id of `abcde`
* `submissions[*].submission_history[*].anonymous_id`
d. The submission history has no `user_id`
* `submissions[*].submission_history[*].user_id`
8. Verify for the student
a. The student id is absent from the student
* `context.students[*].id`
b. The student id is absent from rubric assessments
* `context.students[*].rubric_assessments[*].user_id`
c. The student id is absent from submission comments
* `submissions[*].submission_comments[*].author_id`
d. The student comment has an anonymous_id of `abcde`
* `submissions[*].submission_comments[*].anonymous_id`
e. The student name is absent from submission comments
* `submissions[*].submission_comments[*].author_name`
f. The student avatar is the fallback on submission comments
* `submissions[*].submission_comments[*].avatar_path`
* `/images/messages/avatar-50.png`
9. Verify for the TA
a. The TA id is present on submission comments
* `submissions[*].submission_comments[*].author_id`
b. The TA comment does not have an `anonymous_id`
* `submissions[*].submission_comments[*].anonymous_id`
c. The TA name is present on submission comments
* `submissions[*].submission_comments[*].author_name`
d. The TA avatar is present on submission comments
* `submissions[*].submission_comments[*].avatar_path`
10. Verify for the Teacher
a. The Teacher id is present on submission comments
* `submissions[*].submission_comments[*].author_id`
b. The Teacher comment does not have an `anonymous_id`
* `submissions[*].submission_comments[*].anonymous_id`
c. The Teacher name is present on submission comments
* `submissions[*].submission_comments[*].author_name`
d. The Teacher avatar is present on submission comments
* `submissions[*].submission_comments[*].avatar_path`
C. With AMM Disabled
1. Disable the AMM feature flag
2. Visit the course in SpeedGrader
3. Open the browser network dev tool tab
4. Refresh to ensure the `speed_grader.json` request is present
5. View the response to that request
6. Verify for the enrollments
a. The student id present on the student enrollment
* `context.enrollments[*].user_id`
b. The enrollment does not have an anonymous_id
* `context.enrollments[*].anonymous_id`
7. Verify for the submission
a. The submission has no anonymous_id of `abcde`
* `submissions[*].anonymous_id`
b. The submission has the student id assigned to `user_id`
* `submissions[*].user_id`
c. The submission history has the student id assigned to `user_id`
* `submissions[*].submission_history[*].user_id`
8. Verify for the student
a. The student id is present on the student
* `context.students[*].id`
b. The student id is present on rubric assessments
* `context.students[*].rubric_assessments[*].user_id`
c. The student id is present on submission comments
* `submissions[*].submission_comments[*].author_id`
d. The student comment does not have an anonymous_id
* `submissions[*].submission_comments[*].anonymous_id`
e. The student name is present on submission comments
* `submissions[*].submission_comments[*].author_name`
f. The student avatar is present on submission comments
* `submissions[*].submission_comments[*].avatar_path`
9. Verify for the TA
a. The TA id is present on submission comments
* `submissions[*].submission_comments[*].author_id`
b. The TA comment does not have an `anonymous_id`
* `submissions[*].submission_comments[*].anonymous_id`
c. The TA name is present on submission comments
* `submissions[*].submission_comments[*].author_name`
d. The TA avatar is present on submission comments
* `submissions[*].submission_comments[*].avatar_path`
10. Verify for the Teacher
a. The Teacher id is present on submission comments
* `submissions[*].submission_comments[*].author_id`
b. The Teacher comment does not have an `anonymous_id`
* `submissions[*].submission_comments[*].anonymous_id`
c. The Teacher name is present on submission comments
* `submissions[*].submission_comments[*].author_name`
d. The Teacher avatar is present on submission comments
* `submissions[*].submission_comments[*].avatar_path`
11. Smoke test SpeedGrader
Change-Id: I57806c555b904757876523f4e201cfd8dcd31e61
Reviewed-on: https://gerrit.instructure.com/143287
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
and rename that suite of methods to make more sense
test-plan: N/A
Change-Id: Iffc520ea55141ac47da669663838a4d3c3d8712c
Reviewed-on: https://gerrit.instructure.com/142486
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
and overall maybe suck a little less
test plan:
* enable the feature "SIS Import Refactor"
* lower the threshold to use multiple parallel jobs
via "/plugins/sis_import" to a number like 2
* regression tests for sis batch imports
closes #CORE-927 #CORE-928
Change-Id: I91b0bb0cc0e0957cae7897af453ed2d19555303d
Reviewed-on: https://gerrit.instructure.com/140535
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
allow switching between courses that belong to different grading period
groups
closes GRADE-768
test plan:
* Create three terms in an Account, T1, T2 and T3
* Leave T1 without any grading periods
* Create a new Grading Period set (and grading periods) in T2
* Create a separate new Grading Period set (and grading periods) in T3
such that there is some overlap between the grading periods from this
set and the one you created for T2
* Create five courses, C1, C2, C3, C4, C5
* Associate C1 and C2 with term T1 so they have no grading periods
* Associate C3 and C4 with term T2
* Associate C5 with term T3
* Create assignments in each of these courses with at least one
assignment in each grading period
* Enroll one student in all four of these courses
* Grade this student for all the assignments in all courses
* As the student, visit the grade summary page for C1
* Verify you don't see the grading period filter
* From the filters, change the course to C2 and click "Apply"
* Verify you're now seeing the grade summary page for C2
* Verify the URL does not contain a parameter named "grading_period_id"
* Verify this page doesn't show the grading period filter either
* From the filters, change the course to C3 and click "Apply"
* Verify you're now seeing the grade summary page for C3
* Verify the URL does not contain a parameter named "grading_period_id"
* Verify this page now does show the grading period filter
* Verify the grading period filter shows the current grading period i.e.
one that covers the date/time right now
* From the filters, change the grading period to another one and
click "Apply"
* Verify you're still on the grade summary page for C3
* Verify the URL now does contain a parameter named "grading_period_id"
* Verify this page also shows the grading period filter
* Verify the grading period filter shows the grading period you selected
* From the filters, change the course to C4 and click "Apply"
* Verify you're now seeing the grade summary page for C4
* Verify the URL now does contain a parameter named "grading_period_id"
* Verify this page now does show the grading period filter
* Verify that the grading period filter shows the same grading period
it did for the page you just came from (grade summary for C3)
* From the filters, change the course to C5 and click "Apply"
* Verify you're now seeing the grade summary page for C5
* Verify the URL does not contain a parameter named "grading_period_id"
* Verify this page also shows the grading period filter
* Verify the grading period filter shows the current grading period i.e.
one that covers the date/time right now
Change-Id: If9ceb843fbcc2d5b38f80ef415feaff34a8c96ba
Reviewed-on: https://gerrit.instructure.com/139115
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
fixes CORE-324
test plan
- run a sis import with errors
- the errors should be included in the api JSON
Change-Id: I97e372a82b565e7bfa01cd9ca0bb66bb67c95723
Reviewed-on: https://gerrit.instructure.com/139071
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
this allows us to send different indexes to
multiple workers and process the file in
parallel.
fixes CORE-903
test plan
- specs should pass
Change-Id: I06d8da8c50476f4a62e0138352ab759b4874f8e8
Reviewed-on: https://gerrit.instructure.com/138814
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
test plan
- specs should pass
Change-Id: Iafc7c9b8ca64f32568e658b600e19c2e6f9045ca
Reviewed-on: https://gerrit.instructure.com/138026
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Change-Id: I13eddbe900070b8f50ff5c8f6f016daa27ec87d1
Reviewed-on: https://gerrit.instructure.com/128447
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
fixes CNVS-35635
test plan:
- go to Account Settings > Admin Tools
- click on the View Notifications tab
- search for users that will result in a large number of results
- click on any of the users
- note that a modal pops up with a date range
- select a range
- note that the results update (assuming there's notification to be
found) when you click the Find button and the modal goes away
- note that this provides a decent a11y experience
Change-Id: I57db77950a69842249cace0c738025d9ee131b0d
Reviewed-on: https://gerrit.instructure.com/125818
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
test plan:
* use the API to queue a content migration for a course
with a parameter 'file_url' set to a local url
(i.e. 'localhost:3000/500.html')
* it should not download the file and allow the file
to be downloaded on the content migrations page
for the course
* create a link to a local file
in a piece of course content (i.e. a page)
* run the course link validator
* it should not actually check if the link exists locally
or not, but rather always flag the link
closes #SEC-606 SEC-607
Change-Id: I671c017ec93d88446df77d716725fff8874622bc
Reviewed-on: https://gerrit.instructure.com/125118
Tested-by: Jenkins
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
also remove a method that doesn't do anything
should make things faster maybe?
Change-Id: Ie3849b6faa539317338c6f55a0f7be86b8a20c3d
Reviewed-on: https://gerrit.instructure.com/122440
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
also clean up a final few mocha => rspec-mock translations that
were missed
Change-Id: I805c82c84d73099cc396bf9d3a976ebfc972c84c
Reviewed-on: https://gerrit.instructure.com/120680
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Change-Id: I68cd388bbf7d22d7608a68fbb075493e4a1709fc
Reviewed-on: https://gerrit.instructure.com/120423
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
* ENV['NO_MOCHA']=1 to disable mocha
* switch several core mocks to rspec-mocks
* fix Great Expectations to allow mock expectations
in before blocks
Change-Id: Icee8dee7f01234d2dd4e26ac13562fe9fc93665a
Reviewed-on: https://gerrit.instructure.com/119984
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Change-Id: Ib6f1923b8ff0ec148bfcf5416e3c4d239f5707d5
Reviewed-on: https://gerrit.instructure.com/120243
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
until rcs is open sourced we don't want it enabled by default for
open source users.
closes CNVS-38092
test plan:
- disable rcs feature flag
- rcs should be off everywhere
- from the rails console run:
- Setting.set('rich_content_service_enabled', 'true')
- send SIGHUP to your rails process(es)
- rcs should be on for eportfolios and wiki pages
- enable rcs feature flag
- rcs should be on everywhere
Change-Id: Ibca84b7183dd0344b73433024b47e9948cbab3e8
Reviewed-on: https://gerrit.instructure.com/118223
Tested-by: Jenkins
Reviewed-by: brian kirkby <bkirkby@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
the first two rcs flags have been enabled for all hosted accounts
for a long time. we are changing the lable of the 3rd flag and removing the
first two to provide better clarity as we enable the 3rd flag for
accounts.
closes CNVS-37261
test plan:
- go to the feature flags page for an account
- there should only be one rcs flag with an updated message
- ensure that flag is disabled
- editing wiki pages should still have the new sidebar
- high risk area (i.e. quizzes, assignments) should not have the new
sidebar
- enable the flag
- all editors should be using rcs with the new sidebar
Change-Id: I689eb9ebaf4d3a5fc111c231d13861cc28ae5d87
Reviewed-on: https://gerrit.instructure.com/116542
Tested-by: Jenkins
Reviewed-by: brian kirkby <bkirkby@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
test plan:
see coverage in previous rspec/selenium builds, same numbers as before
Change-Id: I331bf5102914da00a5d350f32b74b4bc9d49c5f8
Reviewed-on: https://gerrit.instructure.com/106895
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
should speed up local testing a lot, and jenkins a little bit (mainly the
rerun phase right now). in a subsequent test repo commit we'll speed up
jenkins a lot, as we'll do a truncate right after we migrate, which means
the cost will be incurred in the post-merge build and not the patchset
build
* don't double truncate one of the shards
* don't randomize sequences unless an env var is set
* don't truncate unless it looks like we've never truncated
(there are Accounts)
* remove some unnecessary switchmanning in rspec-queue
[ci verbose]
test plan:
1. run a spec on a freshly created/migrated test db
1. confirm you see "truncating all tables"
2. confirm you do not see "randomizing db sequences"
2. run the spec again
1. confirm you do not see "truncating all tables"
2. confirm you do not see "randomizing db sequences"
3. run the spec again with RANDOMIZE_SEQUENCES=1
1. confirm you do not see "truncating all tables"
2. confirm you see "randomizing db sequences"
4. in jenkins land on the initial run
1. confirm you see "truncating all tables"
2. confirm you see "randomizing db sequences"
5. in jenkins land on a rerun
1. confirm you do not see "truncating all tables"
2. confirm you see "randomizing db sequences"
Change-Id: Id24026e70afaa35abef4d02249be2c9ba27f1f21
Reviewed-on: https://gerrit.instructure.com/106043
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
closes: CNVS-31785
test plan:
all builds should pass
Change-Id: I2925934692a3d2f115f1289d7b50cb72d8cb907f
Reviewed-on: https://gerrit.instructure.com/104492
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
* completely hide a spec one that we can't (easily) address
* fix the blame assignment of others to not point at generic
monkey patches, instead of the actual caller
Change-Id: I76ad1f871b14104d5b73141210bd9069da43b033
Reviewed-on: https://gerrit.instructure.com/104919
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
most of these are simple fixes, but there are a few where the spec has
actually been broken due to underlying API changes, that were masked
due to the generic raise_error matcher
fixes CNVS-35542
Change-Id: I982e7ab9af59101b79fdf6b2e0816b374a6a6d5b
Reviewed-on: https://gerrit.instructure.com/104750
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
we want to fix them all before we go to rails 5
Change-Id: Ib530df5b2b0bf415c6c2c58bbb1fe6d8c8f6ce01
Reviewed-on: https://gerrit.instructure.com/104753
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
it had critical bugs where mismatched keys would bet let through. so
instead just compare directly; rspec has good hash and array diffing nowadays,
and we just need to call as_json on a few things
Change-Id: I6147e8c988c1dc4f4e3224dc6a4e51e51b27e5f3
Reviewed-on: https://gerrit.instructure.com/104402
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
reimplement it using formatters. notable changes:
1. the index page has separate sections for "Initial", "Rerun 1", etc.
2. you now get error pages for before(:all) failures
3. you now get error pages for non-selenium failures
4. you now get links to pages for failures prior to the current one
5. in addition to not capturing screenshots/videos on too-many-failures,
we now stop making error pages if there are too many, so that we don't
fill up the workspace on mass badness
test plan:
1. see build in repo-who-shall-not-be-named
Change-Id: I54f065f1515f2b639b3f90b471a19e434a17aece
Reviewed-on: https://gerrit.instructure.com/102002
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Find/fix/prevent weird stuff we are doing (or not doing) with `expect`.
Chapter I:
"I have been bent and broken, but - I hope - into a better shape."
Disallow `expect`s in a `before`. `before` is by definition before the
test, so it's not the place to be asserting anything. You can of course
still set up mocks there.
Chapter II:
"Take nothing on its looks; take everything on evidence. There's no
better rule."
Ensure every `expect` actually runs. i.e. it needs `to` or `not_to` in
order to actually do anything.
Chapter III:
"Ask no questions, and you'll be told no lies."
In selenium land, ensure every spec has at least one expecation. In
regular rspec land we just warn to stderr, but we may get more strict
in the future.
Test Plan: Specs
Change-Id: I5fc353ee8171e5191853d45f42ae42478f9220b4
Reviewed-on: https://gerrit.instructure.com/101224
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
refs CNVS-34867
we need to get rid of our old monkey patch of assigns, but allowing
the default behavior of all ivars transfer over is a nightmare with
our factories. so block that behavior, and target to just view specs
a new shim to use the correct way to have explicit assigns
Change-Id: Ifa529f63405d278d3d0dfb09cc66febbeb5be5c3
Reviewed-on: https://gerrit.instructure.com/101562
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
make it Just Work™ for standard exceptions thrown from standard places
also make them pretty on the seleniumfailures page
test plan:
1. see test build w/ failures
2. behold the nice backtraces in the output and on the error pages
Change-Id: Iaa6c57e642bc12d562eb5f3df7894dcb27707ccd
Reviewed-on: https://gerrit.instructure.com/101368
Tested-by: Jenkins
Reviewed-by: Alex Boyd <aboyd@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
we're going to do it again after fork anyway, so it's redundant
Change-Id: Iede3160a8daf63869a42505bbec0496c12336912
Reviewed-on: https://gerrit.instructure.com/100875
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
the idea is to prevent people from making specs slower, while
grandfathering in existing specs
basically:
1. if it's a spec we've seen before, don't let it run much slower than
usual ... basically however long it took in the post-merge, with a
very generous fudge factor
2. if it's a new spec in this commit, enforce an aggressive timeout (10
sec, but configurable via env var)
3. regardless, don't let any spec take more than 60 seconds (not new, but
now configurable via env var) ... since local testing typically won't
have stats available, this will come into play
Change-Id: I4d8de97ccbef324ffde5b04de78db39e915b7e8a
Reviewed-on: https://gerrit.instructure.com/100379
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
the thread_safe gem has deprecations too, but they'll require Rails 5.1
until they're fixed (when both activesupport and tzinfo no longer
depend on it)
Change-Id: Ic53839d911ba8ed4d463d17f9dd7207673510f3a
Reviewed-on: https://gerrit.instructure.com/100499
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
closes CNVS-33615
test plan:
* upload and download files using S3
* submit an assignment
* do an SIS import with parallel
* do a course copy
* export and import a course
* upload some custom css file in theme editor
* test a canvadoc and crocodoc preview
Change-Id: I9145b39728938e7e5903d23c4a4598fc8df4ef45
Reviewed-on: https://gerrit.instructure.com/93002
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
it was unused and our fork has diverged from the main gem. I'd still
love to see bullet get into our linting, but we need to start over on
the approach
refs CNVS-34084
test plan: specs should pass
Change-Id: I46c211e4a21b6234d0e3a4fee1ac91acf2d3c5d0
Reviewed-on: https://gerrit.instructure.com/98789
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
The monkey-patch is necessary to allow shoulda-matchers > 3.0.1
to work with active_model-better_errors. This essentially
provides a working grep implementation to ErrorMessageSet
test plan:
* Ensure specs pass
Change-Id: I1e4b490e98803a62293702fa38951f3dce5fcde4
Reviewed-on: https://gerrit.instructure.com/98513
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
QA-Review: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
fixes CNVS-34164
test plan:
* basic smoke test that translations still work
Change-Id: Ia88fc88de8b52aeaa92b65ea43b93eef5adb1dcc
Reviewed-on: https://gerrit.instructure.com/95065
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
we'll lower this even more in the future, baby steps
typically the lowest selenium spec is 40 sec,
the slowest non-selenium spec is 30 spec
Change-Id: I4bb3a424f7ad44038f980bd8269ae6d1974dc795
Reviewed-on: https://gerrit.instructure.com/98151
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
do this in the outermost around so that any kind of failure gives us a
screenshot page
test plan:
1. see various intentional failures captured on patchset 2
Change-Id: I5aa9f6035ecf327c9a585aafacaa820b10208753
Reviewed-on: https://gerrit.instructure.com/97672
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
This ensures that due dates cannot be set or changed in a way
which puts them into, takes them out of, or adjusts them within a
closed grading period.
closes CNVS-32489
closes CNVS-33037
test plan:
* Test the following endpoints:
* POST /courses/:course_id/quizzes
(quizzes/quizzes#create)
* PUT /courses/:course_id/quizzes/:id
(quizzes/quizzes#update)
* POST /api/v1/courses/:course_id/quizzes
(quizzes/quizzes_api#create)
* PUT /api/v1/courses/:course_id/quizzes/:id
(quizzes/quizzes_api#update)
* POST /api/v1/courses/:course_id/assignments
(assignments_api#create)
* PUT /api/v1/courses/:course_id/assignments/:id
(assignments_api#update)
* A teacher cannot:
* create a quiz/assignment
* with a due date in a closed grading period
* with an override due date in a closed grading period
* with a nil due date when the last grading period is closed
* with a nil override due date when the last grading period
is closed
* change the due date on a quiz or assignment
* due in a closed grading period
* with an override due in a closed grading period
* to a date within a closed grading period
* change the due date of an override
* due in a closed grading period
* to a date within a closed grading period
* unset (nullify) the due date when the last grading period is
closed
* unset (nullify) the due date of an override when the last
grading period is closed
* delete (by omission from parameters) an override due in a
closed grading period
* A teacher can:
* create a quiz/assignment with a due date in an open grading
period
* change the quiz/assignment due date when the assignment is
only visible to overrides
* change the quiz/assignment due date when not within a closed
grading period
* change the quiz/assignment due date when set to the same
value
* An ADMIN does not have these restrictions.
Change-Id: I0da260e831784e7b6d0f6e5a35c43d6ecff9e977
Reviewed-on: https://gerrit.instructure.com/93806
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
in jenkins-land we've historically used db snapshots so the db will be
empty. but if you `rake db:migrate` your test db, you'll have things like
default accounts, notifications, etc., which can break certain specs
Change-Id: I175e651d1b50671e630dc0181d1c4d25e78abe97
Reviewed-on: https://gerrit.instructure.com/95249
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
stub out external stuff in specs. once we do so in plugins, we can
change this to `WebMock.disable_net_connect! allow_localhost: true`
previously it would either allow or disallow requests across the board,
depending on which spec files were loaded, which caused flickering
failures.
Change-Id: I1da58596dc7b781710ed615dd700850d3fea555a
Reviewed-on: https://gerrit.instructure.com/92634
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
it's kind of crazy that you could do stuff like:
"lol".user
i don't know why we didn't do this years ago ¯\_(ツ)_/¯
Change-Id: I0d3f8644729382d6bee889352557792bc353927c
Reviewed-on: https://gerrit.instructure.com/92583
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
for great speed
test plan:
1. the selinimization attempt on this commit should not asplode (currently
asplodes in jenkins due to a newer version of aws-sdk getting
activated). note that it won't get selinimized, cuz spec_helper changed
2. selinimum capture should work locally (and on the post-merge of this
commit)
Change-Id: I89ca259435364b8820646f1b0fd74d92eb1fca1e
Reviewed-on: https://gerrit.instructure.com/91049
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
drop the logging columns and go for it
try to replace as many areas as possible with scopes using
the enrollment states table, give that it is kept nearly
up-to-date and should be faster than instantiating all
over the place
test plan:
* regression test key areas of canvas, particularly
course access
* hold butt
closes #CNVS-30884
Change-Id: Ifa8a663522674eb7856c50de43be50966a086a0f
Reviewed-on: https://gerrit.instructure.com/87339
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
This adds site admin only endpoints for support to fix TII errors
Fixes CNVS-30959
Test plan:
* access /api/v1/support_helpers/turnitin/shard to make sure it kicks
off a new shard fixer job. It should send you a success email.
* make sure that endpoint is only accessible when you are logged in
as a site admin user
You can also edit some of your existing submissions' turnitin_data to
create broken submissions and then test the appropriate fixer.
Change-Id: Ic8ea65b33191825deb4fc693ef994c58bc7aa811
Reviewed-on: https://gerrit.instructure.com/87302
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
make sure all specs are transactional, and that no data setup happens
outside of transactions. this will allow us to use a single test db
for multiple runners.
add a shared_db hint for one spec so that rspec-queue gives it its own
database.
Change-Id: Ifd54b707edfb39970371b78924cf01473dce3a9c
Reviewed-on: https://gerrit.instructure.com/88591
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
* ensure appropriate things are set up before recording and each spec
* remove various unused cleanup-y things
* make BlankSlateProtection.disable restore the previous state
one plugin still needs some massaging around transactions/etc., then we
can turn on BlankSlateProtection and force transactional tests across the
board
Change-Id: I9aacda0f80f94af4dff3ac30c65b5ccd22e7d47d
Reviewed-on: https://gerrit.instructure.com/88397
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
refs SD-1419
also make a tweak to facilitate multiple test processes sharing a db
Change-Id: I1f429538213463b2a025c561523a0c0c782aa8e5
Reviewed-on: https://gerrit.instructure.com/87861
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
our CI now performs some loading magic that
breaks the regular require
test plan:
* verify no explosions for:
COVERAGE=1 bundle exec rspec ./spec/models/user_spec.rb
Change-Id: Ie6c095ce114ae28eeca2d65850fcb1fbc254a450
Reviewed-on: https://gerrit.instructure.com/87698
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
make sure vanilla canvas (no plugins) doesn't blow up when starting up the
thin server
Change-Id: I072a995af4e03bb38cb6edb2355b6fac00710a05
Reviewed-on: https://gerrit.instructure.com/87413
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
- fix spec_helper require
- the API for GradingPeriodController now only accepts
requests with the correct mimetype of 'application/json'
refs: CNVS-27104
Once dev/grading-periods-update lands in master we
need to move the title presence validation from the
controller to the model.
test plan:
- ensure that the new actions in GradingPeriodSetController
are available via the API:
- GET /accounts/1/grading_period_sets
- POST /accounts/1/grading_period_sets
- PATCH /accounts/1/grading_period_sets/1
- DELETE /accounts/1/grading_period_sets/1
- the json data for POST/PATCH looks something like:
{
"grading_period_set": {
"title": "A Grading Period Set Title"
},
"enrollment_term_ids": ["1"]
}
- only users with permissions to the root account may
create GradingPeriodGroups attached to an EnrollmentTerm.
- if a user on a sub account is supplied, the api will
return unauthorized.
Change-Id: I0aa555fbd8d0b803fa7e97a1989de57b9eaf52fe
Reviewed-on: https://gerrit.instructure.com/78078
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Change-Id: I31d9c548faed196a970a3f24e1b251a87b08127b
Reviewed-on: https://gerrit.instructure.com/78451
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
fixes PLAT-1371
test plan:
create an LTI 2 assignment
it should launch
create and LTI 2 assignment that is a module item
it should launch
Change-Id: I9cb77477a5d8eec7742c90e5a3c501fc9b6cdce6
Reviewed-on: https://gerrit.instructure.com/76300
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
test plan
- specs should pass
Change-Id: Ib3f102b53d947198625e3118820d22e77a005dd6
Reviewed-on: https://gerrit.instructure.com/77249
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Make most autoloadable files selinimizable. That means that you can edit
most models/helpers/gems/lib files and only have the relevant selenium
specs run \o/
How does it work?
=================
As with the existing selinimized stuff (controllers/views/css/js/etc), we
capture the dependencies of each spec file in a post-merge build. To
accomplish this, we hook into Rails' autoloading mechanism and give it
some hide/restore magic. This way we can hide all autoloaded constants
from one spec file to the next (technically, top-level example group).
As specs run, constants are loaded (or restored) via autoloading, and
we track all of them.
Then on your patchset build, we synthesize this information with the list
of files you changed. If all files are selinimizable, we can safely run
just a subset of specs.
What things are still not selinimizable?
========================================
* config/* (including routes.rb)
* models loaded when the app starts up (~20%, biggies like User, etc.)
* observers and their models (cuz they really like to load :allthethings:)
* things that are `require`d (`require_dependency` is a-ok though)
Test Plan:
* Normal patchset builds should pass
* Build with capturing enabled should pass and publish to S3
* Test commits based on this one should:
1. Be correctly selinimized if limited to captured autoloads, etc.
2. Not be selinimized otherwise
[selinimum-capture]
Change-Id: I04cea1fa6055d201d72d210a3e9bd770f26769a5
Reviewed-on: https://gerrit.instructure.com/76931
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
since this adds some overhead, it's opt-in. currently passes on master, and
will be turned on for post-merge builds (but not patchsets)
Change-Id: I645fcf56f4bc7ca5fdf401e4c6cb58547f3d71d8
Reviewed-on: https://gerrit.instructure.com/73781
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
test plan:
* try Rails.cache.instance_variable_get(:@data).keys, or any other way
you can think of to try and get all keys (or flushdb or other scary
stuff) from redis
* it should raise an error
* Shackles.activate!(:deploy)
* try again
* it should work
Change-Id: I57772df3851fd14b6a46a56c9cd8ef6ddce015e3
Reviewed-on: https://gerrit.instructure.com/73940
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
test plan:
* basic regression test of assignment overrides
closes #CNVS-27549
Change-Id: Ie463848b3831087efb3f9ec762dca6264055ee76
Reviewed-on: https://gerrit.instructure.com/73139
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>