Commit Graph

38 Commits

Author SHA1 Message Date
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
Cody Cutrer 3227074296 rails 5.1: activesupport-suspend_callbacks
also do a lot of cleanup removing old no-longer-used implementations

Change-Id: Idca5addcb6ebc5226c614462c63c13041c18af27
Reviewed-on: https://gerrit.instructure.com/115710
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 13:44:08 +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
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
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
Simon Williams 6c6f10d402 remove mocha from several canvas gems
refs CNVS-34039
refs CNVS-34040

test plan: specs should pass

Change-Id: I9ef587edd9a5f47fcbe2f6fee74cc4c52efca6fb
Reviewed-on: https://gerrit.instructure.com/98410
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-27 18:18:38 +00:00
Zach Wily 5a2087fea7 make activesupport-suspend_callbacks threadsafe
closes CNVS-33609

This used class instance variables to store callback suspension
information at the class level. Now that is stored in thread data
so that requests across threads don't stomp on each other.

test plan:
 * run canvas in threaded mode with lots of simultaneous requests
   and make sure they don't stomp on each other.
 * or, see spec

Change-Id: I62de11fba229192df54756f9b87dfb81c3772323
Reviewed-on: https://gerrit.instructure.com/88073
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Zach Wily <zach@instructure.com>
Tested-by: Jenkins
2016-12-09 23:31:41 +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
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 baf3df8f44 rails 4.2: fix suspend_callbacks
refs #CNVS-26056

Change-Id: Ied93b069b5124f2e2c9e5587c6d9d2c70d3ae78b
Reviewed-on: https://gerrit.instructure.com/69611
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-05 13:52:00 +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
Dave Gynn 8a73170cc4 performance tune activesupport-suspend for rails 3.2 and 4.0
this skips the expensive compilation of the callback chain methods
unless the model *has* callbacks and callbacks are currently
suspended for the model. if callbacks are not suspended, the
default rails callback logic is performed.
2015-11-26 22:09:02 -08:00
Cody Cutrer e42c68d1af fix backtraces for callbacks
without a __FILE__ passed to instance_eval with a string, ruby wasn't
giving backtraces for anything below, even after calling back to non-evaled
code

Change-Id: Iee74423f7839bbbb44c9a3761220a045d8071681
Reviewed-on: https://gerrit.instructure.com/57377
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-06-29 22:34:32 +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
Strand McCutchen d6597c107c fix Style/EmptyLineBetweenDefs issue
Change-Id: Ib7b824043a7ac9196f06020e2ca42fe983565f0d
fixes: CNVS-20009
Reviewed-on: https://gerrit.instructure.com/52919
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Strand McCutchen <smccutchen@instructure.com>
QA-Review: Strand McCutchen <smccutchen@instructure.com>
2015-04-29 16:28:39 +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
Cody Cutrer 51fb498800 fix callback suspension for ruby 2
need to check for private methods

Change-Id: I5b51b3da9ab3baa8b619c10b684d96fe685a0c9d
Reviewed-on: https://gerrit.instructure.com/36749
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-23 22:01:05 +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 8be0ae37d7 Move google_docs code into a gem
fixes: CNVS-12329

Change-Id: I044725c93582cbca39a61e036bb5f0385e069c1e
Reviewed-on: https://gerrit.instructure.com/32990
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:43 +00:00
Mark Severson 4fbe46509c extract i18n_extraction gem
fixes CNVS-11182

test plan:
 * rake i18n tasks work correctly
 * rake jst tasks work correctly

Change-Id: I9777649e338d81cd7129c887acc18d9ef6722a92
Reviewed-on: https://gerrit.instructure.com/31440
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-21 03:19:30 +00:00
Jacob Fugal f2e7523419 fix activesupport-suspend_callbacks for 4.1
activesupport 4.1 doesn't have CallbackChain inherit from Array anymore,
instead, it houses an internal array and delegates to it.

Change-Id: I5730f734be5e7c0422ac56245609043f52b6425a
test-plan: specs
Reviewed-on: https://gerrit.instructure.com/33081
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2014-04-16 15:12:22 +00:00
Raphael Weiner 9a08d9d934 Move time related code into canvas_time gem
fixes CNVS-10748

Change-Id: If9015c54bf54969d8c47e5e39a372e1c5bfe158b
Reviewed-on: https://gerrit.instructure.com/32532
Reviewed-by: Raphael Weiner <instructure@pivotallabs.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2014-04-14 20:47:01 +00:00
Joseph Rodriguez 86c8d2a7ed Extract paginated collection gem
refs: CNVS-11648

Test Plan:

Test the sub_accounts api endpoint and make sure the pagination
is not broken.

Change-Id: Ie59674a7a834698ac432307940305d6958cb73f1
Reviewed-on: https://gerrit.instructure.com/31413
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 20:14:13 +00:00
Simon Williams 75cb9a19f1 remove one other instance of `git ls-files`
Change-Id: I44d335eb9cc93442b592758733f1912ba46fddf8
Reviewed-on: https://gerrit.instructure.com/31218
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Raphael Weiner <rweiner@pivotallabs.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-03-05 17:50:36 +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
Jacob Fugal d023b40217 ActiveSupport::Callbacks::Suspension
refs CNVS-9522

replace our hokey ActiveRecord::Base.suspend_callbacks implementation
with something that integrates nicely with ActiveSupport::Callbacks in
general, as a gem.

include it into ActiveRecord::Base and use it to implement
save_without_callbacks for rails3 (rails2 still needs to do it the way
we had it before, because the notifications callback isn't handled
through ActiveSupport::Callbacks).

test-plan:
 - make sure ActiveRecord callbacks still run in most cases (e.g. after
   creating a course through the UI, it should have a value in the uuid
   column in the database)
 - make sure callbacks don't run while suspended (e.g. have a user
   enrolled in two courses. call user.delete_enrollments. both
   enrollments should be deleted, but only one delayed job for due date
   caching should be created)

Change-Id: Iecd1cc0346e218261677d16ee44bae9cb9149ddd
Reviewed-on: https://gerrit.instructure.com/29809
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-02-19 20:20:00 +00:00