in qunit, tests run in the namespace of the last module call that
happened. so if you say:
module('module1');
test('test1', function() { ... });
then test1 runs in the namespace of module1. you can pass module1 an
object as a second argument which are functions that will be defined in
the module namespace, and some modules (like setup and teardown) have
special functionality. unfortunately, you can also pass a test in the
module object and it will happily run, but in the namespace of the
previous module definition.
this is all exacerbated by coffeescript! because in coffeescript:
module 'module1'
test 'test1' -> ...
is correct, but
module 'module1',
test 'test1' -> ...
runs the test in the previous namespace. notice the difference? ONE
COMMA! I did an audit of these instances and fixed as many as I could
fine, as well as one legit test issue that came out of fixing them.
Change-Id: I79ea0c673df49e6c09151b50cf765ed9ec760a0d
Reviewed-on: https://gerrit.instructure.com/70950
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
this rabbit hole refactor stems from an observation that destroy_session
could be a no-op (depending on the previous spec), and typically wasn't
useful/necessary. remove lots of other unnecessary stuff, and delineate
more clearly between fake and frd logins
test plan:
1. modified specs (including P2) should all pass
2. all other specs should pass
Change-Id: I8cda5d81f3797c3bb39b98f80c846d346ea36150
Reviewed-on: https://gerrit.instructure.com/70863
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
this should make it easier to get past ordering issues during the rerun
phase and retriggers. conversely, this will also expose more flaky tests
lurking in the suite, so we can fix them
test plan:
1. specs should pass
2. it should still say "Randomize with seed N"
3. it should actually be randomized
Change-Id: Ie109ec79290aa32727d8027ca0ae9cb3e07ce8ef
Reviewed-on: https://gerrit.instructure.com/70891
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
also fixes migrations_paths to be more in line with
default rails behavior
refs #CNVS-26056
Change-Id: Ifce7fce1f0e8e2bb3d9719e952694227816ea861
Reviewed-on: https://gerrit.instructure.com/70929
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Test Plan:
-Specs should pass
-Code review
Change-Id: I9e5835dfdb193c726f03aa72d4d378a1b84f6491
Reviewed-on: https://gerrit.instructure.com/70934
Reviewed-by: Pedro Fajardo <pfajardo@instructure.com>
Tested-by: Jenkins
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Test Plan:
-Specs should pass
-Code Review
Change-Id: Ifff8b0e7c38d8fdd55e95dc34844a438be083ffb
Reviewed-on: https://gerrit.instructure.com/70902
Tested-by: Jenkins
Reviewed-by: Pedro Fajardo <pfajardo@instructure.com>
Product-Review: Pedro Fajardo <pfajardo@instructure.com>
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
closes CNVS-26758
Sentry has a dedicated field for this now, opening up additional
functionality such as a count of affected users for each error.
test plan: enable sentry and trigger an in-request error, the error
report will now include your user id in a separate "user" section.
Change-Id: Ia58d54b923f7daa67e2ce060c02f0cfa0494387d
Reviewed-on: https://gerrit.instructure.com/70918
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
closes CNVS-26745
We were already passing it as a tag, but sentry now has a native release
field that provides additional functionality, so pass it there as well.
We'll keep the tag because it's still nice for searching.
Change-Id: I5447ecabf3cc7246ebc36abd05829320d8d449a7
Reviewed-on: https://gerrit.instructure.com/70889
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
refs CNVS-25916
this spec fails reliably when not all the events have re-bound
yet after switching the leader position of the student. Adding
a normal ajaximations reliably solves the fragility in local
and jenkins node tests.
TEST PLAN:
1) groups_teacher_spec:167 should stop being the most common
fragile spec
Change-Id: I68d39a0566b183d3fb81c6eded599145fda9fc67
Reviewed-on: https://gerrit.instructure.com/70901
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
refs CNVS-26368
the latest switchman version handles connection
disruptions during the re-caching of the default
shard gracefully
TEST PLAN:
1) no behavior should change
2) load up a sharded app
3) force a db exception just as "establish_connection" is
being called for database reconnection after a process
fork
4) the "Shard.default" method should return the
previously cached default shard, not the
DefaultShard.instance
Change-Id: I04c4905a8b2c662473e7e55a38d0b7b2987e343b
Reviewed-on: https://gerrit.instructure.com/70757
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
closes CNVS-26657
Most bundles are extended in plugins with the glue
code method, this second method was only used
by one plugin. Now that we've
ported it to the glue code method, we can remove
this extension mechanism entirely.
Change-Id: Ice1ad4a3308779f12a85b560f624203fdc09d63d
Reviewed-on: https://gerrit.instructure.com/70755
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
This rearranges and redefines much of the user experience on this page.
The score distribution chart is now rendered in HTML from React. Other
charts on the page have been rearranged or tweaked to match the new UI
design.
The new table contains all the screenreader data required, there are no
longer tooltips to be rendered on each score column (now a horizontal bar).
The bar chart is not read to screenreaders.
The bar chart indicates correctness by more than color alone.
The donut chart contains "N% responded correctly" in the center
The donut chart is not read by screenreaders, other than a brief
explanatory message.
Closes CNVS-25737
Closes CNVS-25738
Test Plan:
- Full test of quiz stats for both a11y and basic functionality
- Confirm that webpack and require_js builds are working
- Make sure it looks good!
Change-Id: Ie3f1a2ae99e7b2eea56e97e1cb5b6d3f51b83792
Reviewed-on: https://gerrit.instructure.com/70164
Tested-by: Jenkins
Reviewed-by: Davis McClellan <dmcclellan@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
fixes CNVS-23960
test plan:
- Create a peer review assignment with a rubric
- Assign the review to the same student who submitted it via the api
- Ensure that api does not allow this to happen
(should get a 400 error)
Change-Id: I0cdd3a7856b21c77315f060ef4ffbbd53b32b25e
Reviewed-on: https://gerrit.instructure.com/70498
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Davis McClellan <dmcclellan@instructure.com>
Fixes CNVS-26697
Test plan N/A
Change-Id: Iab7225c5f207476b47d65198958d96f7288f1ab4
Reviewed-on: https://gerrit.instructure.com/70844
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins
Product-Review: Alex Boyd <aboyd@instructure.com>
QA-Review: Alex Boyd <aboyd@instructure.com>
fixes: CNVS-26648
test plan:
you should not see "beta" next to the New UI feature option
Change-Id: Ifcac554dc860f5ad4cc9b90f22f1e0eff2b3484a
Reviewed-on: https://gerrit.instructure.com/70725
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
refs #CNVS-26056
Change-Id: I854a085afc6bff640c814098956344efff65f1a7
Reviewed-on: https://gerrit.instructure.com/70658
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Using the new notification_service allows us to provide more specific
failure feedback to canvas. When we enqueue a message to the
notification service, we pass along the canvas global message id. If
the message fails to send, we enqueue a failure message to a
"notification_failure" sqs queue, and reference the global message id.
This allows us to write failure information off to the canvas message
object and put it into an error state.
Test Plan:
* Start local fake_sqs environment
If using docker
`$ docker pull feathj/fake-sqs`
`$ docker run -it -p 9494:9494 -e VIRTUAL_HOST=sqs.docker feathj/fake-sqs`
If running native
`$ gem install fake_sqs`
`$ fake_sqs`
* Create `<canvas>/config/notification_failures.yml` file and place
the following in it:
If using docker
```
development:
use_ssl: false
sqs_endpoint: sqs.docker
sqs_port: 9494
access_key_id: access key id
secret_access_key: secret access key
```
If running native
```
development:
use_ssl: false
sqs_endpoint: localhost
sqs_port: 4568
access_key_id: access key id
secret_access_key: secret access key
```
* Create a canvas message to put in error state
* Login to canvas
* Create new conversation message
* Open rails console and confirm that message.state is not
"transmission_error", also take note of message id
* Start canvas jobs, from canvas-lms directory:
`$ bundle exec script/delayed_job run`
* Manually enqueue failure message to fake_sqs
```
require 'yaml'
require 'aws-sdk'
require 'aws-sdk-core'
require 'aws-sdk-resources'
require 'aws-sdk-v1'
client = AWS::SQS::Client.new(
use_ssl: false,
sqs_endpoint: '<YOUR_SQS_HOST>',
sqs_port: <YOUR_SQS_PORT>,
access_key_id: 'access key id',
secret_access_key: 'secret access key'
)
client.create_queue(queue_name: 'notification-service-failures') rescue
nil
queue_url = client
.list_queues[:queue_urls]
.reject { |queue| /dead/i.match(queue) }
.detect { |queue| /notification-service-failures/.match(queue) }
puts queue_url
puts client.send_message(queue_url: queue_url, message_body: {
'global_id' => <YOUR_MESSAGE_ID>,
'error' => 'the message failed to send amigo'
}.to_json)
```
* Verify that message is state is set to "transmission_error" and the
transmission_errors field has your error message
closes CNVS-26442
Change-Id: Ic379142727d4e186ae3032241caca1b1e4c5e074
Reviewed-on: https://gerrit.instructure.com/70447
Reviewed-by: Christina Wuest <cwuest@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
scope.new no longer keeps the record out of the association
refs #CNVS-26056
Change-Id: I5867253645c1020cde8853ccc389a0730c241652
Reviewed-on: https://gerrit.instructure.com/70788
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
refs #CNVS-26056
Change-Id: I1ad89e2d9922e9994937963b0ad783eccebc5bc5
Reviewed-on: https://gerrit.instructure.com/70759
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
to no longer hide the Rails 4.0+ method of the same name
Change-Id: I979fd002c9bb6b168d3d8fd9998545c2d217e68d
Reviewed-on: https://gerrit.instructure.com/70806
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fixes index_exists?, add_index, remove_index, and
add_foreign_key method calls in migrations
unhacks remove_index to fail silently if the index
doesn't exist (and removes some unnecessary remove_index calls)
also fixes migration specs for rails 4.2
refs #CNVS-26056
Change-Id: Id878aa4cb871fc5ae6d0d4e7c6e8cfe1c5d88d35
Reviewed-on: https://gerrit.instructure.com/70692
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>