Commit Graph

47 Commits

Author SHA1 Message Date
Isaac Moore 0af34dc97e Use shared db for dynamo in Jenkins
This prevents the database from being access key-dependent.

refs AE-554
flag=none

test plan:
- build and specs still pass

Change-Id: Idc0c5e7949ea27bd56f787a937e83febf498a2f4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/338513
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Build-Review: James Butters <jbutters@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
2024-01-24 15:34:29 +00:00
Aaron Ogata 485dc1df16 don’t perform redundant DB operations in Jenkins test runs
refs DE-1207

Change-Id: I93d69baf2235dd0cdf243f3188813661b19d3c41
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292928
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
2022-06-01 17:42:18 +00:00
Jacob Burroughs 4253bed58b Use zeitwerk everywhere always
Change-Id: Ide7490f4e8d2447b147328b6f7e2afc545941c14
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287599
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-03-22 18:54:50 +00:00
Jacob Burroughs 5664ee7b75 Don't override CANVAS_RAILS6_0 in compose
Change-Id: I8ee2f750c34cf3fb989322041c19de33aafad5ea
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285412
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>
2022-02-17 16:34:04 +00:00
Jacob Burroughs 888baaf6e4 Allow using rails 6.1 in jenkins
Change-Id: I789009a956751510825092c084db128aaf085ec4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285337
Product-Review: Charley Kline <ckline@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-02-16 21:49:00 +00:00
Ethan Vizitei fc439c30bf parameterize class caching in test
closes FOO-2539
flag=none

TEST PLAN:
  1) specs pass

Change-Id: Ibd4030767a8f015b3c197a568d7bb26a91dca92d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277273
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2021-11-02 17:06:57 +00:00
Ethan Vizitei df8851251d Revert "Revert "Add a jenkins stage to enforce zeitwerk compliance""
This reverts commit 9c5244ca5b.

Reason for revert: Time to reapply

Change-Id: I63aafdd3056f26423e510560e76b1f6d0fca4c52
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276733
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-27 21:01:43 +00:00
Ethan Vizitei 9c5244ca5b Revert "Add a jenkins stage to enforce zeitwerk compliance"
This reverts commit fc538f4336.

Reason for revert: unblock existing builds

Change-Id: I68e254fee49d0305b43e6f489e3ed88f52b3167e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276731
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-26 17:05:33 +00:00
Ethan Vizitei fc538f4336 Add a jenkins stage to enforce zeitwerk compliance
refs FOO-2439
flag=none

TEST PLAN:
  1) build passes
  2) introduce a non-zeitwerk-compatible constant
  3) next build fails

Change-Id: Ib4594b056ffb222f5217f7df8c50abd289872c93
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276279
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-26 15:03:08 +00:00
Kyle Rosenbaum d310b75f47 add RspecQ under feature flag; refs DE-803
RspecQ can now be used to run tests using the
'use-rspecq' commit message feature flag

test plan:
- build runs as normal without use-rspecq enabled
- enabling use-rspecq commit flag runs tests using rspecq,
no tests run via old rspec/slenium groups
- test numbers match between differing builds
- build artifacts are created with or without feature flag
- build summary report works with or without feature
flag

Change-Id: Ibaf32177a8ec28a89278eaa4277bd7a752cbfc58
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272130
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
2021-09-01 20:26:52 +00:00
Aaron Ogata a1a55bd406 Revert "split rspec / selenium stages by thread"
This reverts commit c131c39e3d.

Reason for revert: broke Jenkins

Change-Id: I9b6f25f4b6f2128cae7e763073d3a3eadcd0ea30
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/264748
Reviewed-by: Andrea Cirulli <andrea.cirulli@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>
2021-05-18 13:55:22 +00:00
Aaron Ogata c131c39e3d split rspec / selenium stages by thread
refs DE-644

[canvas-builds-refspec=c30dc5a5768e38eb7ef483a6b8b5e7c30af8a25d]

Test Plan
1. RSpec / Selenium use correct number of nodes and run correct number of tests
2. RSpec / Selenium retry according to RERUNS_RETRY value
3. Build Summary Report generates correctly

Change-Id: I886e41a8712bda5a98f58eee0ba42d034a08db25
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265014
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-05-17 14:11:02 +00:00
Aaron Ogata 71207a592f remove unused MAX_FAIL variable
refs DE-444

This extra parameter isn’t used anywhere, so remove it.

Change-Id: I487e7a6d73fdd218f87263fdf1a8970057ae3ef8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/264900
Reviewed-by: Andrea Cirulli <andrea.cirulli@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>
2021-05-13 14:40:37 +00:00
Kyle Rosenbaum 347f73b172 remove docker_processes from core rspec and selenium test runs
refs DE-467

it is no longer possible to spin up multiple docker containers
ona  single rspec or selenium agent when running tests. parallelization
is now exclusively done through multple rspec processes on
a single container.

test plan:
- setting docker_processes ENV variable has no effect
- settting rspec_processes still runs multiple test threads
- tests continue to run as expected given that docker_processes has
been set to 1 for multiple months.

Change-Id: I604d953a71ad220373b6a71d558f46bff29f820e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263701
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2021-05-12 19:47:12 +00:00
James Butters 7c27182cfa enable rails 6 for testing
adding variables to use rails 6 in new test build.

Test Plan:
- Jenkins build pass
  - rails 5 is installed and used
- Run Main-from-plugin
  - rails 5 is installed and used
- Run new rails6 build
  - rails 6 is installed and used
- Run new rails6 plugin build
  - rails 6 is installed and used

Change-Id: Ib4441f2eb6fb8946089c17bf81ec16bcb7b42020
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250840
QA-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-10-23 14:49:00 +00:00
Aaron Ogata 1bfb887395 cache migrations by md5sum
refs DE-23

[change-merged]
[build-registry-path=jenkins/canvas-lms/de-23-test]

flag = none

Test Plan:
1. Jenkins pre-merge build with a new migration re-builds migrations
2. Jenkins pre-merge build with migrations cached does not re-build
3. Jenkins post-merge build with migrations cached re-builds migrations
4. skip-cache directive does not use the cached migration
5. Jenkins non-main builds works as expected
6. Jenkins FSC works as expected

Change-Id: I3221400a15220884740ad5136de7185a88ae2b39
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241013
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-10-08 16:39:18 +00:00
James Butters c5fb85082a new build for parallel log generation
closes: DE-119
flag = none

Test Plan:
-Regular jenkins builds pass
-New build Canvas/test-suites/rspec-parallel-log
  -passes and pushes gerrit with new log
  -fails and does not run create gerrit stage
    -once one step fails, entire build is failed immediately

Change-Id: I965676e26927ec5b539532cdf87191cc52db9151
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242157
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-07-31 17:27:02 +00:00
Aaron Ogata 841ef7933d abstract docker image tags to shared variable
refs DE-24

flag = none

Test Plan:

- Main Build
- Main Build (PG12)
- Main-From-Plugin Build
- Master Bouncer
- Translations
- Performance (Chrome)
- Flakey Spec Catcher
- Coverage, from canvas-builds

Change-Id: I9f1d44d5c9725ed2e1ca9c66a4d5b2836ea78168
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241292
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
2020-07-20 14:47:35 +00:00
Derek Bender a09f6902ed Alpine canvas-lms based image
Drop-in replacement for existing Dockerfile

Closes: CCI-391

Change-Id: I9d21a74d72013be854631b2f77880eb0c47fded2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236853
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-07-15 17:21:56 +00:00
James Butters 482c134c94 combine docker yamls into one
combine docker-compose.new-jenkins.yml and
docker-compose.new-jenkins.multple-processes.yml into one since
they are very similar.

flag = none

test plan
  -All Jenkins builds still pass

Change-Id: I63737562aa054cd471fbd165227b928f93731371
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241393
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-06-29 16:37:55 +00:00
Derek Bender 8eac98ab2e Spec: add `init: true` to jenkins builds
This will allow use to rely upon builtin "tini" functionality
without needing to manually invoke it like before. This should
ensure that stopping containers is faster across the board.

Change-Id: I101770a6ddcf5cdc216b612bde83156d40198127
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240309
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-06-16 14:09:58 +00:00
Aaron Ogata cb2035e7b8 don’t rebuild images if already pulled
These images are currently pulled from the cache or built in docker-compose-pull.sh; and docker-compose-build-up.sh is rebuilding them. Fix this so that the cached image is used for our build files.

refs DE-3

Test Plan:
1. Ensure Jenkins passes

flag = none

Change-Id: Id8b4954ee452d2534b898f9d782b67b9730f542c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239644
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-06-15 19:11:12 +00:00
James Butters 335f6c8c46 spec: more parallel of docker, better even
using the option project-name with docker-compose allows
us to have all services separate for each group of tests.

test plan:
Jenkins passes all build
logs are copied out of containers for archiving/test reports
run with force-failure flag


flag = none
closes: CCI-341

Change-Id: I99820f64023dde17a1b75e76bcec2dfe84529e91
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236029
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-05-11 15:07:18 +00:00
Derek Bender 11c01f4b66 Configure databases in a unified manner
This patchset removes the much duplicated database.yml and instead
defaults to a DATABASE_URL scheme. There is however still present a
docker-compose/config/new-jenkins/database.yml file to temporarily allow
our internal portal service to still function until such time we can
reconfigure it.

To set up custom connection options all that is needed is setting
DATABASE_URL. See examples of this in docker-compose.yml and
docker-compose.new-jenkins.yml.

Test Plan
=========

Image:
- pulling canvas-lms:master image boots without database errors

Repo:
- given default dev environment where
  COMPOSE_FILE=docker-compose.yml:docker-compose.override.yml

- build the web and postgres images: docker-compose build web postgres
  (feel free to comment out `yarn install` and `compile_assets` in the
  Dockerfile since we won't be needing them for this test and this
  speeds things up)

- set a custom DATABASE_URL to change the database name and echo it to
  see it gets into the image correctly:

    $ docker run -it -e \
      DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \
      $(docker-compose ps -q web) bash -c "echo \$DATABASE_URL"
    => postgres://postgres:sekret@postgres/canvas_custom_env

    $ docker-compose run --rm -e \
    DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \
    web bash -c "echo \$DATABASE_URL"
    => postgres://postgres:sekret@postgres/canvas_custom_env

- Test that setting a custom database name via DATABASE_URL can create
  the database

    $ docker-compose run --rm -e \
    DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \
    web bash -c "bin/rails db:create"
    => Created database 'canvas_custom_env'

- This patchset boots on portal

Change-Id: Ic6f3819550df94b6c98b17ef05ac2029a578cfe4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234213
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
QA-Review: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2020-04-28 22:42:21 +00:00
Derek Bender 7e452e280e setup postgres extensions on all test dbs
Closes: CCI-345

Test Plan:
- set your COMPOSE_FILE to docker-compose.new-jenkins.yml
- remove any existing database volumes via
  `docker rm canvas-lms_pg_data` or `docker-compose down -v`
  which will remove all volumes in the project.

- update the image with `docker-compose build postgres`
- start the container

    $ docker-compose up --detach postgres

- create a second database:

    $ docker-compose exec -T postgres createdb -U postgres \
      -T template1 canvas_test1

- check both databases:

    $ seq 0 1 | parallel "docker-compose exec -T postgres psql -x \
      -U postgres \
      -d canvas_test{} \
      -c \"SELECT * FROM pg_available_extensions \
        WHERE name = 'pg_collkey';\"

- Expect two records to be present:

    -[ RECORD 1 ]-----+-------------------------------
    name              | pg_collkey
    default_version   | 0.5.1
    installed_version | 0.5.1
    comment           | ICU collation function wrapper

    -[ RECORD 1 ]-----+-------------------------------
    name              | pg_collkey
    default_version   | 0.5.1
    installed_version | 0.5.1
    comment           | ICU collation function wrapper

Change-Id: If1417df3edab788372927b16632e146069a6829e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235310
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-04-27 18:25:57 +00:00
Derek Bender 7c97f93a18 disable spring in ci, again
Closes: CCI-344

Test Plan: No mention of spring in any stage that uses
build/new-jenkins/docker-compose-create-migrate-database.sh

Change-Id: Iafe5bb635bf936f83fdad1170398bb8852ebb804
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235312
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-04-27 15:27:13 +00:00
S. Jacob Powell 263d065a93 Add force-failure flags for selenium and rspec
test plan:
Here is a forced failure for all (force-failure):
https://jenkins.inst-ci.net/blue/organizations/jenkins/Canvas%2Fmain-canvas/detail/main-canvas/28534/pipeline/363

Here is a forced failure for rspec(force-failure-rspec):
https://jenkins.inst-ci.net/blue/organizations/jenkins/Canvas%2Fmain-canvas/detail/main-canvas/28558/pipeline

Here is a forced failure for selenium (force-failure-selenium):
https://jenkins.inst-ci.net/blue/organizations/jenkins/Canvas%2Fmain-canvas/detail/main-canvas/28559/pipeline

Here is a forced failure for JS (force-failure-js):
https://jenkins.inst-ci.net/blue/organizations/jenkins/Canvas%2Fmain-canvas/detail/main-canvas/28561/pipeline

Feel free to run these locally, just pass in an env var to the test when
running it, and set it to 1 (FORCE_FAILURE=1 <test command>)

fixes CCI-316

flag = none

Change-Id: Ida6e25f5c1df71074ea26298c8f1b640df1b7a45
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/233265
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Rex Fleischer <rfleischer@instructure.com>
Product-Review: Jacob Powell <spowell@instructure.com>
2020-04-22 18:42:53 +00:00
James Butters bf5a8f5a2a use parallel_tests for more parallelization
Using the parallel_tests gem allows us to parallelize more
and a bit simpler. Removes headless stuff now that we don't
use it anymore, comments out video recording code since it
doesn't work, removes all knapsack code.

flag = none
Test Plan:
Jenkins rspec and selenium builds pass
rspec and selenium builds copy results to html publisher
rspec and selenium have nodes split into processes

Change-Id: Ibd00eba77f8193be5eadd41aef1e0617c9ae470c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/227677
Reviewed-by: Jacob Powell <spowell@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-03-30 21:38:47 +00:00
Derek Bender 78123c4cb6 Multiple rubies and postgres on Jenkins
Closes: CCI-214
flag = none

Test plan:
- The following builds pass:
  - main-canvas
  - main-for-coverage
  - main-canvas-postgres-12
  - main-canvas-ruby-2.6
  - main-canvas-postgres-12-ruby-2.6

Change-Id: I253d0cc8f0a808d8453fd3cbe1cfc3400ec8b12a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/227304
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-03-10 22:30:51 +00:00
Derek Bender 3ad7fbabf3 Upgrade unofficial postgis repo to official repo
Closes: CCI-261

The mdillon repo was an unofficial postgis repo, there is now and
official postgis/postgis repo!

https://registry.hub.docker.com/r/postgis/postgis/
https://github.com/postgis/docker-postgis

Test Plan:
- First, take notice if you currently have pg_collkey installed:
    $ docker-compose run --rm postgres psql -x \
        -h postgres
        -U postgres
        -d canvas
        -c "SELECT * FROM pg_available_extensions WHERE \
          pg_available_extensions.name = 'pg_collkey';"

  If `installed_version` is blank, then the extension is not isntalled
  into the `canvas` database.

- take down any running environment:
    $ docker-compose stop && docker-compose down

- copy (or update) new settings from docker-compose.override.yml:

    # manual diff
    $ diff config/docker-compose.override.yml \
        docker-compose.override.yml

    # overwrite any existing config
    $ cp config/docker-compose.override.yml .

- copy (or update) new settings from database.yml:

    # manual diff
    $ diff docker-compose/config/database.yml config/database.yml

    # overwrite any existing config
    $ cp docker-compose/config/database.yml config/

- rebuild and startup the postgres image:
    $ docker-compose up --build postgres

- the postgres logs do not mention

ERROR:  could not access file "$libdir/collkey_icu.so":
  No such file or directory

- install the extension if it wasn't previously present:

    $ docker-compose run --rm postgres psql -x \
        -h postgres \
        -U postgres \
        -d canvas \
        -c "CREATE EXTENSION IF NOT EXISTS pg_trgm SCHEMA public;
            CREATE EXTENSION IF NOT EXISTS postgis SCHEMA public;
            CREATE EXTENSION IF NOT EXISTS pg_collkey SCHEMA public;"

    $ docker-compose run --rm postgres psql -x \
        -h postgres \
        -U postgres \
        -d canvas_test \
        -c "CREATE EXTENSION IF NOT EXISTS pg_trgm SCHEMA public; \
            CREATE EXTENSION IF NOT EXISTS postgis SCHEMA public; \
            CREATE EXTENSION IF NOT EXISTS pg_collkey SCHEMA public;"

- pg_collkey is now present:

    $ docker-compose run --rm postgres psql -x \
        -h postgres
        -U postgres
        -d canvas
        -c "SELECT * FROM pg_available_extensions WHERE \
          pg_available_extensions.name = 'pg_collkey';"

    $ docker-compose run --rm postgres psql -x \
        -h postgres
        -U postgres
        -d canvas_test
        -c "SELECT * FROM pg_available_extensions WHERE \
          pg_available_extensions.name = 'pg_collkey';"

- Optionally, Build the postgres container with fresh volumes:

    $ COMPOSE_PROJECT_NAME=<a-unique-name> docker-compose --build \
        up postgres

- The postgres logs show no errors related to collkey_icu.so
  (like above)

Change-Id: I4f0e027cd908fee937b6204cd3a20e5ecf998021
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228190
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-03-04 22:03:02 +00:00
S. Jacob Powell 6ac58ae346 Pull database images instead of building each time
test plan:
Passes jenkins including on merge
No longer builds the database images, it pulls them instead

fixes: CCI-233
Change-Id: I15d96fc901115aa0d1718c1b5794898524b8eb59
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/226597
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Jacob Powell <spowell@instructure.com>
Tested-by: James Butters <jbutters@instructure.com>
Tested-by: Rex Fleischer <rfleischer@instructure.com>
2020-02-13 20:13:24 +00:00
Rex Fleischer 527ec9c6ed add rspec coverage to main-for-coverage build
fixes: CCI-170
flag = none

Test-Plan:
manually main-for-coverage with this specref and ensure
coverage is uploaded

Change-Id: Ifc67a65157e8ad5853b01664fe81e177f8bba0d6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/226086
QA-Review: Rex Fleischer <rfleischer@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2020-02-12 16:45:43 +00:00
Brian Watson 5dbd07d68c implement flakey_spec_catcher build
To optimize re-runs, FSC uses the same settings for
RSpec::Core::Runner but just clears the RSpec example queue
between runs. The changes in spec/selenium/common.rb ensure
that we don't start up a new webserver and driver when there
is already one existing. This creates connection issues.

closes: CCI-225

Test-plan:
 > export COMPOSE_FILE='docker-compose.new-jenkins.yml:docker-compose.new-jenkins-flakey-spec-catcher.yml:docker-compose.new-jenkins-selenium.yml'
 > docker-compose up -d
 > docker-compose run --rm web flakey_spec_catcher
 - verify that no specs are re-run
 - Try making changes to other selenium and api specs, re-run
 > docker-compose run --rm web flakey_spec_catcher
 - and make sure that the results appear as expected

Change-Id: I005ca9dec5e75f72788a7db5a9fa640f69071f6d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218480
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-02-11 19:39:47 +00:00
Derek Bender cf4c31ecac Fix standalone performance build for nightly runs
Closes: CCI-7

flag=none

Test Plan:
- Main build passes normally
- Trigger a build manually for `selenium-performance-chrome` with this
  patchset's refs/changes/18/219818/<PATCHSET_NUMBER>
- The build should run normally without configuration type failures

Change-Id: Icc67d1274783b47166ea10f09061cc76727fbc62
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219818
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2019-12-12 22:42:11 +00:00
S. Jacob Powell 0792f9d96a Cache migrated database
Overview:
This patchset is intended to save time by saving and loading migrated
containers and reusing the image.
It checks to see if all three database images were loaded (the cached
ones) and if so, then it uses those instead of migrating from scratch.
If one of them is not loaded, it performs the regular process.
The storing of the migrated images will only happen on merge.
It does run migrate on the cached images, but it correctly skips
anything that was already done.

This pattern will be repeated in each sub build, which should save a lot
of time not having to redo the migrations.

Test plan:
View the build and confirm that it passes when loading cached migrations
Should be about a minute or more faster

Fixes: CCI-30

Change-Id: Iba878bb646fd976deab5d624e8960cac63d09677
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/213268
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: S. Jacob Powell <spowell@instructure.com>
Product-Review: S. Jacob Powell <spowell@instructure.com>
2019-11-15 21:33:55 +00:00
Cameron Matheson e0804049cd run dynamodb in new jenkins
Change-Id: Ifc6676447ad065a30f3e8154444d5c00ed8afac3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/211347
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
Product-Review: Robert Lamb <rlamb@instructure.com>
2019-10-31 17:10:55 +00:00
Cameron Matheson f1e792b629 handle knapsack environment vars better
Change-Id: I5115f3cdee0e892f2d0feaa55b8dfdf228d4aa31
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/213844
Reviewed-by: Robert Lamb <rlamb@instructure.com>
Tested-by: Jenkins
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2019-10-31 16:29:28 +00:00
Cameron Matheson ef12a8fad8 fix MAX_FAIL/RERUNS_RETRY warnings
Change-Id: I1a81e9c92cf3d112c58f91567550934ec20f3bc7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/213843
Reviewed-by: Robert Lamb <rlamb@instructure.com>
Tested-by: Jenkins
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2019-10-31 16:28:44 +00:00
Cameron Matheson 56d89a3df4 only include KNAPSACK env vars when necessary
this avoids a bunch of warnings in the un-knapsacked builds

Change-Id: I5caf6bd94d5d7b3350a492b739f6d712c7e34829
Reviewed-on: https://gerrit.instructure.com/211667
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Tested-by: Jenkins
2019-10-02 20:44:31 +00:00
James Butters b3e014a81a spec: add rspec-with-retries.sh for better rerunning of rspec
Change-Id: I5728c9cd0c36c42d79fd0da0f0e9b2849df54c7f
Reviewed-on: https://gerrit.instructure.com/210582
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-10-01 14:23:54 +00:00
James Williams 99a54a8c4a spec: pull new jenkins images from starlord
so we don't get rate-limited from docker hub

closes #CORE-3344

Change-Id: I5c8f0e1716a84966dc9b0f0f8595a474649f89cb
Reviewed-on: https://gerrit.instructure.com/211250
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Jenkins
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-09-27 15:31:42 +00:00
James Williams 56a487811b spec: knapsack for selenium
Change-Id: I30c0c0006de8779dea1743d6c626022756f05d5a
Reviewed-on: https://gerrit.instructure.com/210564
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-09-25 14:13:39 +00:00
James Williams 18cad7be4c spec: undo security.yml overwrite
Change-Id: Id4a31fe3d3c8784b65730d7c62d3bd1ef68767ed
Reviewed-on: https://gerrit.instructure.com/210756
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Jenkins
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-09-25 12:17:37 +00:00
James Williams 2768dda033 use knapsack in new jenkins rspec build
closes #CORE-3292 #CORE-3293

Change-Id: Id54c8568bd1ca45929f35926e0eebdd558e68a58
Reviewed-on: https://gerrit.instructure.com/207602
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
2019-09-13 15:19:34 +00:00
Robert Lamb f48744cfbb spec: remove 'master' fallback & use PATCHSET_TAG
For New Jenkins builds, don't fallback to pulling the image from
master if the patchset image isn't available.  We don't want the
tests to pass against the wrong image.

Use PATCHSET_TAG instead of re-creating the starlord url.

Change-Id: Id77e4110f597308064922c1bb37d03b520a4d6b9
Reviewed-on: https://gerrit.instructure.com/206742
Tested-by: Jenkins
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-08-26 20:52:29 +00:00
James Butters 355b92601b spec: separate selenium config into selenium.yml
most builds do not need selenium container so move the selenium
config into it's own yml and only add to env variable when
needed.
Removed docker-compose-build.sh, add docker-compose build code
into the build scripts.

closes: CORE-3253

Change-Id: I5698019c69dd8940624589928b8a7d4b65f940a5
Reviewed-on: https://gerrit.instructure.com/206247
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-08-26 12:43:08 +00:00
Derek Bender 38bdaa8b54 Smoke test docker image
Closes: GRADE-2048

Test Plan:
- specs pass
- canvas-image in new-jenkins passes

Change-Id: If8369df6467dd5842d8f19190ec5a952ce0f750b
Reviewed-on: https://gerrit.instructure.com/187292
Tested-by: Jenkins
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
Reviewed-by: Robert Lamb <rlamb@instructure.com>
2019-04-05 14:25:16 +00:00