Commit Graph

15 Commits

Author SHA1 Message Date
Michael Hargiss 7293ebc942 add quiz lti contract tests for live events
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>
2018-04-10 14:20:18 +00:00
Cody Cutrer f50f695176 upgrade to aws-sdk v3
Change-Id: I52ed6d98b70cac11f3004789fb750ace79c5a0d8
Reviewed-on: https://gerrit.instructure.com/110693
Reviewed-by: Tyler Pickett <tpickett@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-26 15:30:08 +00:00
Michael Brewer-Davis 589593b5c3 symbolize live events
- also uses .to_json to convert hash to json string; ensures
  no duplicate keys
  
closes PLAT-2588

Test plan:

Test alongside g/111746 (MRA)
Configure live events on local, or test against portal2.
Run canvas-lms/script/tail_kinesis [endpoint] [stream] [region]
  to see a log of all live events.
  For local (no creds required):
      script/tail_kinesis http://kinesis:4567 live_events us-east-1
  For portal2 (inseng creds):
      script/tail_kinesis \
         http://kinesis.us-west-2.amazonaws.com \
         cyoe_live_events_qa \
         us-west-2
Create a quiz in Canvas
As a student, take the quiz
Verify the ensuing grading events do not have duplicate keys
As a teacher, change the answers to a quiz question, and choose
  to regarde the quiz
Verify the ensuing quiz regraded event does not have duplicate
  keys

Change-Id: I0653363527ed9e39f56bcb84bcf0641e953d964c
Reviewed-on: https://gerrit.instructure.com/111745
Reviewed-by: Chris Wang <cwang@instructure.com>
Tested-by: Jenkins
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Chris Wang <cwang@instructure.com>
2017-05-14 01:30:14 +00:00
Tyler Pickett ba0e7c6568 Allow LiveEvents to use env vars or an EC2 instance role
Fixes: CNVS-35832

This will allow us to configure the feature via consul w/o storing
credentials in the clear. This has been made possible by our new app
servers having an instance role we can use.

Test Plan:
- Enable Kinesis and Consul for docker
- Create the kinesis stream according to doc/live_events.md
- Add some dummy AWS credentials to the web and jobs containers
- Configure live events at `/plugins/live_events`
  - Check "Configure using Consul..."
  - Leave the rest blank
- Tail the kinesis stream using script/tail_kinesis:
  script/tail_kinesis http://kinesis.canvaslms.docker live-events us-east-1
- Create a course
- A live event should appear in the tailer window.

Change-Id: I136709697a7145491ec18fc712c6278f38f5eaef
Reviewed-on: https://gerrit.instructure.com/110200
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2017-05-10 16:07:49 +00:00
Tyler Pickett 183ea84bb4 Make LiveEvents gem configured by a hash instead of PluginSetting
Refs: CNVS-35832

This makes us a little more flexible in what we can supply without
having to resort to attempting to fake the PluginSetting API.

Change-Id: If37ab5242fb54dcfb59323c5ef95822a85f2bb80
Reviewed-on: https://gerrit.instructure.com/109956
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2017-05-10 16:07:35 +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
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
Cody Cutrer 3c1da2a4df validate live events credentials and stream name
Change-Id: I632d8d70da512f4e2580e40f3b0cf6347d30f4cf
Reviewed-on: https://gerrit.instructure.com/94090
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-01 22:02:53 +00:00
Michael Brewer-Davis a7963bd3eb ensure grade_change events have canvas context
closes: CYOE-357

Test plan:
On a Canvas instance running in rails production mode:
1.  Create an assignment with some graded submissions
2.  Modify the points possible of the assignment so
    that the submission scores will be updated
3.  Verify that the generated live events are
    - coming from a delayed job
    - include the job information in the context
    - include the account id, account lti_guid,
      context id (course id) and context type ("Course")

Change-Id: I651b97a47f61f9d969161bc6c2360102e61eb2d3
Reviewed-on: https://gerrit.instructure.com/93663
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2016-10-27 14:59:29 +00:00
Cody Cutrer 489d9d1f99 convert live events to AWS SDK v2
Change-Id: I665840e2163184ffe6a81a7701f33db5257c42fb
Reviewed-on: https://gerrit.instructure.com/92742
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-10-18 20:57:22 +00:00
Cody Cutrer 167267ad59 add aws-sdk v2 to gemfile
it can coexist with v1, and now we can move our usages over to v2
one at a time

Change-Id: I6aa1ff3f46dbe3762ee2548d41ffd26e4c1b26fe
Reviewed-on: https://gerrit.instructure.com/92704
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-10-13 16:11:35 +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
Jason Madsen 8b78946c58 move canvas_statsd and related to external gem
closes CNVS-20323

canvas_statsd has been packaged and published as its own gem. remove
code from gems/ and other supporting code.

updated initializer to conform with new gem default tracking options

test plan:

  - enable statsd in config/statsd.yml
    - visit several pages in canvas
      - create some things, updates some things
      - reload a page or two
      - canvas should continue to function as expected
      - the following statsd request keys for controller actions should
        continue to be sent:
        - total
        - db
        - view
        - sql.read
        - sql.write
        - sql.cache
        - active_record

Change-Id: I28fbf8642a3d2719b08721a3df1c7b77ac52cb1f
Reviewed-on: https://gerrit.instructure.com/54251
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2015-05-18 15:53:19 +00:00
Zach Wily 5d232f03af initial live events implementation
This commit adds a new module called LiveEvents that knows how to send a
certain set of events to Kinesis. The module is configured via
normal plugin settings per account. Once the plugin is configured with
a Kinesis stream, events will start getting sent to that stream.

Events are sent asynchronously, in a background thread.

test plan:
 * See `doc/live_events.md` for instructions on how to setup a local
   kinesis stream and configure the LiveEvents plugin.
 * Start tailing the stream with the command specified in
   `doc/live_events.md` in a terminal.
 * Perform the actions described in `doc/api/live_events.md` and verify
   that events show up in your Kinesis terminal with the correct data.

Change-Id: Id799688c972205a1eee84a673912f84b0c7abb57
Reviewed-on: https://gerrit.instructure.com/50324
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Product-Review: Zach Wily <zach@instructure.com>
2015-04-03 15:22:33 +00:00