refs AE-31
flag=none
test plan:
- verify Canvas boots in CD
- verify no influx of new errors in CD
[fsc-timeout=1]
[ignore-stage-results=Flakey Spec Catcher]
Change-Id: I26663e32d9452c198c87b957b026170ee3e4bc93
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/305073
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
closes AE-30
flag=none
test plan:
- verify Canvas boots in CD
- verify no influx of new errors in CD
[fsc-timeout=30]
Change-Id: Ifa04bebe1b09f01c6d3b8b2d8f3bb424759730f5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308067
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
Build-Review: James Butters <jbutters@instructure.com>
During test execution a sequence of tests fail with:
"Only Redis glob strings are supported: /^dynamic_settings\//"
This is because Redis does not support regular expressions
as parameters for "cache.delete_matched(...)"
The accepted format is glob
(see https://redis.io/commands/keys/)
fixes DE-1463
flag=none
test plan:
- existing tests pass and the above error is not found in the flaky failures
Change-Id: I411faef90bb4b0f7b7e3e3ff948453cac23e5a19
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/305400
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
refs QUIZ-9943
flag=none
test plan:
- Create a JWT to your user in local Canvas
- Call /api/v1/services/rce_config with the following header:
'Authorization: Bearer [your token]'
curl --location --request GET '[host]/api/v1/services/rce_config' \
--header 'Authorization: Bearer [your token]' \
--header 'Accept: application/json'
Change-Id: I2afa87010c0225d23d651abbe0fb54a1cfece447
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300089
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Marton Balogh-Bodor <marton.balogh-bodor@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Roland Beres <roland.beres@instructure.com>
flag=none
[skip-stages=Flakey Spec Catcher]
Test-plan:
- verify that minimal files are displayed for missing in the map
- ensure that Test Plan junit displays ~45,000 specs run
Change-Id: I516103e3d3348b4f7deaf4124044e8276dfc707e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288539
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
refs FOO-2746
https: //github.com/rails/rails/commit/c4845aa7791839fcdf723dc77e3df258e7274496 now uses DupCoder for memory_store, which is unable to properly serialize a SchemaCache object.
Change-Id: I5e5e14931742ef9465a9542f1acedaee4d0bb4a3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287112
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
flag=none
Test-plan:
- run crystalball map, junit `Test Report` item should appear
- in crystalball_map job, the crystalball collator in the final
stage should report >= 40,000 specs
Change-Id: Id4f12671f1bc136c19d8d2f8e4fdcef844e1690c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286485
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
Change-Id: I89129633731a68c38a5026b6b26318d1f3699a2a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284968
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
flag=none
Test-plan:
- unit tests have entries in the crystalball map
Change-Id: I9a05fd5c050f0b4142dfc19fb3b960fdb00f3584
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283875
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
flag=none
Test-plan:
- generate new map, make sure more things are present without
losing things
Change-Id: I135673942b1fd6353e2a22d2c0441449bab531b2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280525
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
Note: Ensure that istanbul is only enabled for crystalball before
this is merged
closes OUT-4918
flag=none
Test-plan:
- crystalball map should include JS files
- ensure that CRYSTALBALL_MAP isn't set to 1 in standard pre-merge
Change-Id: I5ae2f32177640e3caeb77871918644890eb4ae30
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280813
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
closes OUT-4926
flag=none
Test-plan:
- coverage should be complete
- coverage in latest jenkins build should match
what's visible in code-coverage.inseng.net
Change-Id: Ia64778433a698e7f2eb8bbd2a5e9621662eedb03
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281119
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
refs DE-920
flag=none
It's easy to forget to run migrations on your test db. This commit
checks before rspec spins up and will bail early with a helpful
reminder.
TEST PLAN
1) make sure your db migrations are up to date
> RAILS_ENV=test bundle exec rails migrate
2) run a sample rspec test
> bundle exec rspec -fd spec/support/test_database_utils.rb
- it should run normally without failures
3) rollback the most recent migration
> RAILS_ENV=test bundle exec rails db:rollback STEP=1
4) run the same sample test
> bundle exec rspec -fd spec/support/test_database_utils.rb
- it should fail with PendingMigrationError
5) run the same sample test with SKIP_MIGRATION_CHECK=1
> SKIP_MIGRATION_CHECK=1 bundle exec rspec -fd spec/support/test_database_utils.rb
- it should run normally without failurs
6) rerun steps 1 & 2
Change-Id: I4dfd11ae40f48295c3f1967e4b4b847adb1277af
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280910
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Bobby Buten <bobby.buten@instructure.com>
Product-Review: Bobby Buten <bobby.buten@instructure.com>
closes OUT-4895
flag=none
Test-plan:
- after job builds, new map should be visible in instructure-canvas-ci
bucket
Change-Id: I3fa98f1da7e4b75f6b24dedff5a9cb35c3e08eb6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280200
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
Also moves config/initializer/crystalball.rb to spec/support
to prevent it from running in prod
This reverts commit 9a9c68be6e.
Test-plan:
- passes cd to edge without failure
- generates map successfully in PoC build
Change-Id: I67c02ebaea06e11b3a3721aa49217da16e75bd32
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279848
Reviewed-by: Michael Hargiss <mhargiss@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
This reverts commit bd847c2d14.
Reason for revert: breaking cd
Change-Id: I85ed1dc69045d2cd984778da12c2e0b402b842ad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279637
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
flag=none
Test-plan:
- #crystalball-noisy should link to the latest build AND the
latest map should be linked (stored as a build artifact)
- job should run nightly
- nightly alerts should promopt #crystalball-noisy posts
(but not gerrit manual triggers)
Change-Id: Ibbd45dfd8a9b3ed8f4c662b322214cbbc3dc99b4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277205
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hargiss <mhargiss@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
test plan
- run specs
- the should run
refs LS-2818
flag=none
Change-Id: Ief1662f3b0fdb8af94d069cdf9c019a337ad30c4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278478
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
[skip-stages=Flakey]
auto-corrected with post review ensuring line breaks continue to
convey original meaning of separated conditions, and cleaning up
some now-duplicated conditions
Change-Id: Ib9b31226de0665a2e4427fe595639d0d91a33f83
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279151
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
[skip-stages=Flakey]
auto-corrected, with post-review changing hashes that were meant
to be string keys in the first place
Change-Id: I877a365b9035bb62cea4d3b2f01f641f55b63281
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278676
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
[skip-stages=Flakey]
manual
also use methods on Pathname while we're auditing these, to simplify
Change-Id: I4ff00329a7de9d39f5797790c22b55f7bb661c05
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278481
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
[skip-stages=Flakey]
Naming/HeredocDelimiterNaming and Rails/SquishedSQLHeredocs
the former was manual, the latter was automatic. I also changed
some <<- to <<~ to allow for better formatting
I also had to change comments inside squished SQL heredocs to
be block comments (since newlines are removed); searching for those
I found some multi-line strings that are better as heredocs
Change-Id: I6b138f8e32544b97df1e4c56f09ee5316cbdef9d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278184
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
[skip-stages=Flakey]
auto-corrected (with manual post-review looking for possible non-array,
non-string slices that might go bad, with none found)
Change-Id: I00feba96f58f701ed1f668f86928b8871d0d8ef2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277991
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
and activate this user while on the "secondary" in tests
Canvas uses read-only secondary database replicas, but before now,
GuardRail.activate(:secondary) had no effect in specs. The result
is that specs wouldn't catch attempts to write to a secondary,
and the error would be discovered in production, often requiring
a hotfix.
This patchset sets up a migration that creates a `canvas_readonly_user`
in the database and sets up SELECT permissions for it in each
shard's schema. (The migration does nothing in production.)
It also stubs out GuardRail in specs to run
`SET ROLE canvas_readonly_user` when activating the secondary,
and `RESET ROLE` when returning to the primary.
test plan:
- specs pass (this PS includes specs that attempt to write to
the secondary and verify the correct error is raised)
- use the read-only user in development by adding the following
to the development section in config/database.yml:
secondary:
username: canvas_readonly_user
then try to write to the secondary in the rails console and
ensure you get a permission denied error. for example,
GuardRail.activate(:secondary) { User.create! }
should result in
PG::InsufficientPrivilege: ERROR: permission denied for
table users (ActiveRecord::StatementInvalid)
flag = none
closes LS-2818
Change-Id: Ibfa75af821eb7f5d65f6b26aea03417378ab255a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/161086
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
[skip-stages=Flakey]
the balance. mostly. Lint/UriEscapeUnescape is put in the pending
block because it's so touchy, and I didn't want to deal with it
right now
all manual
Change-Id: Ibeb81e013f56f160d51f7d237a9bcfe98daa1e53
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277569
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
[skip-stages=Flakey]
all manual, and this concludes this cop for the entire codebase, so
change it to error severity to enforce it
Change-Id: I770c62bbd93ccd4f0b11252fd0cf61158f1ee7cb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277357
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
[skip-stages=Flakey]
so we don't have to manually do it, especially with increasingly
complicated relative paths.
and stop manually requiring it in plugins, and also convert any other
require File.expand_path to require_relative
Change-Id: Ifc07149372fe09bcc146ac1b980feb3a9fd62865
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276816
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>