Commit Graph

51 Commits

Author SHA1 Message Date
Rob Orton e430f35de0 stop logging stats in adheres_to_policy
refs CORE-2538

test plan
 - specs should pass

Change-Id: I09ffd6982be803294b7d70c1e485d999a01352ea
Reviewed-on: https://gerrit.instructure.com/186260
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-03-21 16:29:16 +00:00
James Williams 7423e4fb94 rails 5.2
closes #CORE-1301 #CORE-1302

Change-Id: I687132b066d12cf35e3c7a593dff9b2a91337f33
Reviewed-on: https://gerrit.instructure.com/147220
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2018-04-25 19:15:20 +00:00
Tyler Pickett 465afda22f Add a flag to completely disable caching of permissions
Fixes: CNVS-38111

Test Plan:
* Disable permission caching
  `Setting.set('permissions_cache_enabled', 'false')`
* Start up your web server and visit any page
* You should not see any Redis requests for permissions in your
  development logs

Change-Id: Ib91a0b7fc9ca8db121f942984e26f44d19d2400b
Reviewed-on: https://gerrit.instructure.com/118850
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
Tested-by: Jenkins
2017-07-18 12:41:34 +00:00
Tyler Pickett 41a66e4d49 Allow us to disable caching of intermediate permissions
Fixes: CNVS-38113

By intermediate permissions we mean permissions used to determine if the
directly queried one matches, for example in `app/models/account.rb` we
have a :create_tool_manually permission that checks if the user can
:lti_add_edit. Before this patch both permissions would get written to
the Rails cache, with this patch and the flag set to false :lti_add_edit
won't get written but the top level :create_tool_manually will.

Test Plan:
* Set the new flag to false:
  `Setting.set('permissions_cache_intermediate', 'false')`
* Start tailing the development log grepping for setting permissions
  `tail -f log/development.log | grep 'setex permissions'`
* Create an LTI1 tool registration using the UI, you should see a
  permission named `create_tool_manually` get cached while one named
  `lti_add_edit` should not.

Change-Id: I88ba5cc03d1a13030f53194554d6eee3c287c10d
Reviewed-on: https://gerrit.instructure.com/118656
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2017-07-17 17:11:54 +00:00
Tyler Pickett 1393e9e7fc Add setting to disable related permission caching
Fixes: CNVS-38114

We were just blindly caching everything that could be cached when
calculating permissions, it turns out these aren't actually used very
frequently so we're going to try turning caching of them off.

Test Plan:
* With Redis backed caching enabled
* Tail your development log grepping for setting permission caches:
  `tail -f log/development.log | grep 'setex permissions'`
* Visit your main account settings page: `/accounts/1/settings`
* Note that there are many manage, update, and delete permissions
  written to redis.
* In a console disable related permissions caching:
  `Setting.set('permissions_cache_related', 'false')`
* Reload configuration values for your web process (SIGHUP or restart)
* Reload the account settings page, note that there are only redis
  writes for read permissions now instead of many others.

Change-Id: Ic5a73a5124b42405fed79bede37aff70322d0c54
Reviewed-on: https://gerrit.instructure.com/118480
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2017-07-12 19:22:24 +00:00
Tyler Pickett f1e4031514 Add blacklist for permissions caching
Fixes: CNVS-38110

This is the first of a few knobs we'll be adding to give the ability to
tune rails cache traffic coming from adheres_to_policy. We're adding
these because it constitutes a very large portion of the current redis
traffic with a fair bit of that traffic writing keys that never end up
actually being read based on some recent log analysis.

Test Plan:
* Tail your development log grepping for `manage_courses`
  `tail -f log/development.log | grep manage_courses`
* Visit an account's courses page: /accounts/self
* The tailed logs should show a Redis get and setex for a permissions
  key on accounts.manage_courses
* In a console run
  `Setting.set('permissions_cache_blacklist', 'account.manage_courses')`
* Restart your web server
* Visit the account courses page
* The logs should no longer include the Redis traffic

Change-Id: I566f58e70687c4fcffe7369b94f38e62f1318ce8
Reviewed-on: https://gerrit.instructure.com/118378
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2017-07-12 17:52:43 +00:00
Cody Cutrer 68f5e6065c prep for Rails 5.1
several gem bumps for versions compatible with rails 5.1, and loosening
requirements on in-repo gems.

Change-Id: I4849b053690527e812bb1042fde8142520452123
Reviewed-on: https://gerrit.instructure.com/115650
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-06-16 02:54:20 +00:00
Landon Wilkins c5b5cc786d da licença part 53
add consistent license headers to all source files

Change-Id: I405d2def01ad68c76533b9254983497485cd7073
Reviewed-on: https://gerrit.instructure.com/110160
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-05-01 21:06:11 +00:00
Tyler Pickett 5a67acc83a Track permission generation for redis loggging
We weren't tracking this so we couldn't get an idea of how much our
caching was saving us.

Change-Id: I41cc595a34e6cf709a945420a5e75efdcdcbb57d
Reviewed-on: https://gerrit.instructure.com/109494
Tested-by: Jenkins
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2017-04-25 20:24:56 +00:00
Jon Jensen be84615841 bump simplecov, fixes SD-2056
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>
2017-04-04 18:06:25 +00:00
Spencer Olson cebfe9c463 fix moderated grading post permissions
closes CNVS-35293

test plan:

1. Create a moderated assignment.
2. As a user who can edit grades, review and give a provisional grade.
3. As a user with the "Moderate grades" and "Edit grades" and "View all
   grades" permissions, visit that assignment's moderation page. Verify
   there is a "Post" button and students are listed. Verify you can
   post grades.
4. As a user with the "Moderate grades" and "Edit grades" permissions
   and without the "View all grades" permission, visit that
   assignment's moderation page. Verify there is a "Post" button and
   students are listed. Verify you can post grades.
5. As a user with the "Moderate grades" and "View all grades"
   permissions and without the "Edit grades" permission, visit that
   assignment's moderation page. Verify there is no "Post" button and
   students are listed.
6. As a user with the "Moderate grades" permission and without the
   "Edit grades" and "View all grades" permissions, visit that
   assignment's moderation page. Verify there is no "Post" button and
   no students are listed. Also verify there is no checkbox next to the
   "Student" header.
7. As a user with the "Moderate grades" and "View all grades"
   permissions and without the "Edit Grades" permission, try to publish
   a moderated assignment via the API (api/v1/courses/:course_id/
   assignments/:id/provisional_grades/publish). Verify the response
   comes back as unauthorized.

Change-Id: Iffacc6c4eb314f7d8730786d627dffaf5623bc4a
Reviewed-on: https://gerrit.instructure.com/104659
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>
2017-03-16 21:34:19 +00:00
Cody Cutrer 5876d2ea0e instrument permissions
fixes CNVS-34170

test plan:
 * configure statsd.yml
 * use the app
 * observe data sent to statsd, and logged, re: permissions

Change-Id: I1ff35f4679fffcac49774e1bad0cf2540b7f17b8
Reviewed-on: https://gerrit.instructure.com/99727
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-02-17 20:10:27 +00:00
Simon Williams 359c6dea13 upgrade many canvas gems to rspec 3 syntax
as of this commit, all canvas gems should be on rspec 3.5, and pass
without deprecation warnings.

closes CNVS-34040

test plan: specs should pass without deprecation warnings

Change-Id: I556b1a4a5aeb791c6ddd50ee35b51c513e025019
Reviewed-on: https://gerrit.instructure.com/98414
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2016-12-27 18:44:23 +00:00
Cody Cutrer d6f9064c3a allow Rails 5 for in-repo gems
Change-Id: Iebb04b73dfdd9c19ca51273b3bfa2b8f7bc1bb3a
Reviewed-on: https://gerrit.instructure.com/95407
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-11-17 15:07:58 +00:00
James Williams 651ce93c2e fix permissions caching around 'institution' course visibility
test plan:
* create a course with 'institution' visibility
 (i.e public to authenticated users)
* visit the course syllabus as a random user
* visit the course home page
* it should not show an unauthorized message

closes #CNVS-32584

Change-Id: I5a85ba83334fb5099af8f3002197ae74af7a1573
Reviewed-on: https://gerrit.instructure.com/93215
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-10-24 20:04:44 +00:00
Neil Gupta f707a228cd Decouple grades and comments in gradebook api
Fixes CNVS-29511

Sometimes when posting a comment, the incorrect grade was being
applied. This commit decouples the 2 features and DRY's up the code to
address this issue.

Test plan:
* As a teacher, setup an assignment with a letter grade scheme.
* As a student, submit an assignment.
* As a teacher, go to the submission detail view.
* Start typing a comment but don't submit it.
* Enter a grade of 95. The grade should submit and display as "A", but
	the comment should not be submitted. Refresh page to confirm.
* Post a comment. It should post but the grade should still be 95.
	Refresh the page to confirm.

Change-Id: I1eb7478e0c693ee28a58578e45dd7369b24baa05
Reviewed-on: https://gerrit.instructure.com/81568
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
2016-06-15 22:17:17 +00:00
Cody Cutrer f552f4fc00 simplify gem test harnesses
rely on test_all_gems.sh to output header and trailer,
and use `set -e` in each test.sh to simplify passing
through errors

Change-Id: I3ba724ad2539ddfe31195394c43f646acfc73920
Reviewed-on: https://gerrit.instructure.com/70469
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-01-19 17:52:58 +00:00
James Williams d2833299d7 remove rails 3 support
also add initial rails 4.2 scaffold

refs #CNVS-25988

Change-Id: Ifd7aecaffb6cfc8a3e41bc3fb011fb6ce0664ea6
Reviewed-on: https://gerrit.instructure.com/69129
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-12-23 21:36:43 +00:00
Cody Cutrer 421cfafabb allow rails 4.2 on gems that pass specs with it
Change-Id: I55b1ea783d924ffad60d1ce8de3be030b36bf519
Reviewed-on: https://gerrit.instructure.com/69155
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-12-17 22:50:17 +00:00
James Williams 7f3eb3b828 cache 'false' values in adheres_to_policy
should improve performance in requests when permissions
 are checked for users that don't have them

(e.g. student grade summary page)

refs #CNVS-21317

Change-Id: I349a02664bcc81da1808e76bbc023f5d743f90a4
Reviewed-on: https://gerrit.instructure.com/56846
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-06-22 15:58:28 +00:00
Alex Boyd 45702c0659 Allow adheres_to_policy policies to have nested policies
Fixes CNVS-20926

Test plan:
 - Regression test several pieces of Canvas that use adheres_to_policy
   - This is almost everything, including calendar, discussions,
     accounts, assignments, groups, courses, sections, enrollments,
     submissions, quizzes, and wiki pages.
   - You'll specifically want to test every situation where a 401
     Unauthorized should be sent back to a user or where a user should
     otherwise not be permitted to view a certain thing or perform a
     certain action and ensure that they continue to enforce the same
     restrictions that they used to.
   - You'll also want to test situations where a user should be allowed
     to view a certain thing or perform a certain action and ensure
     that they are still able to.

Change-Id: I643e6462584213adf2d415057fa59277a8627043
Reviewed-on: https://gerrit.instructure.com/55663
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Alex Boyd <aboyd@instructure.com>
2015-06-12 20:36:14 +00:00
Simon Williams 72415e8460 do some cleanup on gem test runs
* add test runner for broadcast_policy and fix a couple of tests that
  had been broken by accident
* add test runner for canvas_quiz_statistics and add a reference to
  iconv to it's Gemfile to allow tests to run in ruby 2
* add a test runner for canvas_sanitize
* remove leftover cruft from running gem builds in both rails 2 and 3

Change-Id: Iab2a0986f277a82c096e1fff2dab1d3a55b91733
Reviewed-on: https://gerrit.instructure.com/54518
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2015-05-18 22:39:17 +00:00
Shawn Meredith bebc309651 spec: simple_cov tweaks
Change-Id: Ib7db93b7ce5c877d2c0dcf24ee0d748f11ec58cb
Reviewed-on: https://gerrit.instructure.com/44806
Reviewed-by: Adam Ard <aard@instructure.com>
Product-Review: Adam Ard <aard@instructure.com>
QA-Review: Adam Ard <aard@instructure.com>
Tested-by: Adam Ard <aard@instructure.com>
2014-11-24 17:39:14 +00:00
Shawn Meredith e52ff14e2c spec: simple_cov tweaking
Change-Id: I0d870506404a384a335449ee3ffbc0750b425ea7
Reviewed-on: https://gerrit.instructure.com/44711
Reviewed-by: Adam Ard <aard@instructure.com>
Product-Review: Adam Ard <aard@instructure.com>
QA-Review: Adam Ard <aard@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-11-21 22:21:52 +00:00
Cody Cutrer 48864de3f6 begin rails 4
enough for bundle install to work with 4.1.5

Change-Id: I277df9e4315fa250b6028139113c74721148e2f0
Reviewed-on: https://gerrit.instructure.com/39656
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-08-27 23:09:17 +00:00
Paul Hinze 071d6d8a96 align rspec version in gems with parent
update spec_helpers to fix deprecation warning after upgrade

Change-Id: I31b370d1d60f73d5256c69a8d5e69418657f880d
Reviewed-on: https://gerrit.instructure.com/39144
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
QA-Review: Paul Hinze <paulh@instructure.com>
2014-08-12 22:27:39 +00:00
James Williams 81558f728c remove rails 2 support
closes #CNVS-14261

Change-Id: I1b0e8a4438ab659ecd1ac8462bc3559d810989b3
Reviewed-on: https://gerrit.instructure.com/38744
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-08-06 18:16:19 +00:00
Jacob Fugal daf6143e0b session_affects_permissions -> permissions_key
fixes CNVS-13711

test-plan:
 - regression tests of:
   * permissions of admin with pending invitation to a course
   * user that typically would not have access to a portfolio, but
     visited the portfolio with a verifier string earlier in the session
     (but has no verifier string now)
   * access to attachments on the safe file domain

Change-Id: Ie321c77655e6ba5e87fd35a079086a48608f5d0e
Reviewed-on: https://gerrit.instructure.com/38029
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-07-30 16:16:18 +00:00
Cody Cutrer f20c2a144e fix caching of non-persisted objects
refs CNVS-13848

they can't be cached, because they likely differ

Change-Id: I9f4a98f0bad4da399d02e10b0165892245584dff
Reviewed-on: https://gerrit.instructure.com/37406
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-07-19 00:42:14 +00:00
Nick Cloward f96ef2c3d1 make permission_cache_key_for shard aware
fixes: CNVS-13917

Moves the initializer from active record base to an alias method chain
on AdheresToPolicy::Instance methods.  The way its including the
instance methods did not allow it to override the
permission_cache_key_for method.

Test Case:

  - Flush cache
  - Open a Course
  - Look at the cache keys and all the ids should be global ids

Change-Id: Iac6a5ed95a800c27bd53fcb757cabd11976aef21
Reviewed-on: https://gerrit.instructure.com/37226
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-07-11 16:11:17 +00:00
Nick Cloward b995981ccc permissions are not caching correctly due to returns
fixes: CNVS-11197

Cleans and simplifies the code to remove the returns and nexts.
The block was short cuirciting the cache methods withe the returns.
Since the caching for permissions is more aggressive a few places in
specs need to clear the cache.

Test Plan:

- Clear cache
- Open a course page
- Check cache to make sure there are permission keys stored for that
  course.

Change-Id: Ib7f747242bfb4394a73876377f4b6ba632f8b728
Reviewed-on: https://gerrit.instructure.com/37100
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-07-02 19:34:22 +00:00
Cody Cutrer b51d0898cd adheres_to_policy improvements
refs CNVS-11425

 * be more strict about the DSL
 * store policies so that we can avoid linear searches for
   an applicable condition block

Change-Id: I68f6414b396e1cb16d744d0719cdd6aa86085784
Reviewed-on: https://gerrit.instructure.com/36222
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-24 15:32:00 +00:00
Nick Cloward 5091754e48 remove grants_rights? and cached_context_grants_rights?
refs: CNVS-11425
refs: CNVS-11197

Change-Id: I9df4d3c408be0a1aede6cc987a982b5e2f688ce0
Reviewed-on: https://gerrit.instructure.com/35829
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-06-20 20:23:04 +00:00
Nick Cloward e9595976c1 clean up permission calls for grants_rights?
refs: CNVS-11425

Change-Id: Ia0145e4b4d1da9e0f83a1845647ce203b3586057
Reviewed-on: https://gerrit.instructure.com/34280
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-19 18:10:30 +00:00
Nick Cloward e690395a9c increase permissions performance
fixes: CNVS-11425

This is a performance refactor of the permissions.  The
biggest change is the caching.  The cache key is now based
on the right so each right will be cached by itself.  The
goal is to reduce places where we implement caching for
permissions and let adheres_to_policy handle it.

Another commit is coming to clean up calls to the new
methods created here.  g/34280

Test Plan:
  - Make sure permissions all work still.
  - Make masquerading still works with permissions.
  - Make sure switing views such as "student view" for a
    course.

Change-Id: I4a30b0aba394cea24c3b60167fc1369a2584f5a4
Reviewed-on: https://gerrit.instructure.com/34278
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-18 22:27:39 +00:00
Cody Cutrer 92ea7c5be5 bundle check before bundle install for gem tests
they're likely already installed, and it will save a ton of trips
to rubygems.org

Change-Id: I9ccf2194619a6e8f97d7f21b4e232dac7ff20d3c
Reviewed-on: https://gerrit.instructure.com/35694
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 20:09:10 +00:00
Shawn Meredith e6de56a029 spec: vendored_gems pin rspec versions
Change-Id: Ibad1c172e58a69eb3a5a9ff2c874e861086ae227
Reviewed-on: https://gerrit.instructure.com/35756
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 14:54:02 +00:00
Simon Williams dc3b16f9bf add gem names to gem script runners
Change-Id: I0dad5345aae75e552af97f5b54ded10bbfebbe37
Reviewed-on: https://gerrit.instructure.com/33925
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-04-28 15:51:28 +00:00
Raphael Weiner dea07dc90f loosen rails version requirements for gems
fixes: CNVS-12259

test plan:
- run unit tests, run bundle, verify app starts up without rails version
  conflicts

Change-Id: Iddd6167bbb8a4cc61ca015fc979236659e24da73
Reviewed-on: https://gerrit.instructure.com/33126
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2014-04-10 20:28:03 +00:00
Cameron Matheson 89c78ecc75 don't ruin cached_context_grants_right? in test mode
Change-Id: I543cd76eac17dfc60b3ce058f735450f4c54c863
Reviewed-on: https://gerrit.instructure.com/32054
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-03-20 18:50:50 +00:00
Cody Cutrer 36e8d99b46 force a separate lockfile for rails 3
also move the RAILS3 sentinel into the config folder, for easier
deploys, and normalize how sub-gems decide on rails 3

Change-Id: I39fda434bb3d94cf72e66774b6b9d11c968a3d5a
Reviewed-on: https://gerrit.instructure.com/31632
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-03-10 22:43:47 +00:00
Shawn Meredith 26090c0298 spec: simple_cov vendored_gems report merging
Change-Id: I2421119792dcd6f8b02618c9ecfb050e00a104bd
Reviewed-on: https://gerrit.instructure.com/31013
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
2014-02-28 09:04:50 +00:00
Shawn Meredith 2f23ac7924 Revert "Revert "spec: vendored_gems coverage result merge with canvas""
This reverts commit 7c29516091.

Change-Id: I37c31c26dcb4456664714848a7b9cb12ab40a755
Reviewed-on: https://gerrit.instructure.com/30900
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
2014-02-27 07:34:24 +00:00
Shawn Meredith 7c29516091 Revert "spec: vendored_gems coverage result merge with canvas"
This reverts commit 19a27ae758.

Change-Id: Icd11deec1340057bf2a1fc541a9a7848d11d6b7e
Reviewed-on: https://gerrit.instructure.com/30881
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
2014-02-26 17:43:38 +00:00
Shawn Meredith 19a27ae758 spec: vendored_gems coverage result merge with canvas
Change-Id: Ic2bd9a9045da4aa417f60b66ef08ca9d470ec2bb
Reviewed-on: https://gerrit.instructure.com/30829
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2014-02-26 08:11:20 +00:00
Shawn Meredith 420ec475de spec: vendor_gems test.sh result determination tweak
Change-Id: I68ca527f6e48e0305315d824aaf9a9625ecd8276
Reviewed-on: https://gerrit.instructure.com/30675
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-24 19:54:21 +00:00
Shawn Meredith 89b2072df3 spec: canvas rspec rake task for vendored_gems
Change-Id: I8aceb8e5aa2b95790eadca83725c8fd03bd28965
Reviewed-on: https://gerrit.instructure.com/30621
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-24 05:47:34 +00:00
Simon Williams 63830287ea don't use git to build vendored gem specification file list
fixes CNVS-11072

test plan: in a canvas repository without a .git directory (like a deploy) call
a bundle command (like script/console).  it should not give you warnings about
missing .git directories

Change-Id: I2daa1371d97c94f7c3db81d3fd2bad387fcabaf8
Reviewed-on: https://gerrit.instructure.com/29947
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-12 22:58:25 +00:00
Simon Williams 663776ada8 clean up stringex gem tests
* clean up sqlite db after tests run in stringex gem
* test Redcloth correctly in stringex gem
* move database cleanup to test runner in stringex
* keep rails2 Gemfile.lock after running gem test runners

closes CNVS-11020

test plan:
- stringex tests should still pass in rails 2.3 and 3

Change-Id: Idde773ddf3c8158bb0040a2eae9d4ecc8c8c2d15
Reviewed-on: https://gerrit.instructure.com/29781
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Raphael Weiner <rweiner@pivotallabs.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-11 23:17:51 +00:00
Raphael Weiner 9044087ae1 use test.sh scripts for all gems
Change-Id: If97bbe476b8bf747e3b83bb7bf22783e2508da69
Reviewed-on: https://gerrit.instructure.com/29507
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-04 22:23:57 +00:00