Commit Graph

56 Commits

Author SHA1 Message Date
Aaron Ogata 9c6e169d55 convert contract tests to using docker bridge network
refs DE-715

Test Plan
1. Contract Tests passes

[canvas-builds-refspec=755cccfd95de9aafca779c0a1f5697fc9eb40b6f]

Change-Id: I077ae015ca7c50cf4d8774958438a948649c2fbf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267131
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-06-15 16:37:49 +00:00
Aaron Ogata 3dbf596e03 convert contract tests to EKS-compatible syntax
refs DE-707

Change-Id: I0d823124c25b879ff3c572240720f39ba9371909
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267009
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-06-15 13:57:51 +00:00
Aaron Ogata 3998b7a026 convert contract tests to extendedStage pattern
refs DE-707

Test Plan
1. Test count aligns with current master
2. Outcomes publish API step doesn’t publish on pre-merge and does publish on post-merge

Change-Id: Ic69f9b74137ffd36fc5a0964e5880a59457fca36
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266983
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: Ryan Norton <rnorton@instructure.com>
2021-06-14 15:29:15 +00:00
Andrea Cirulli 796257539e fix linter rules
Fix following linter issues:
- ParameterName
- CouldBeSwitchStatement
- UnusedMethodParameter

refs DE-690
flag = none

test-plan:
- Build passes
- QA build that triggers FSC and executes the spec changed

Change-Id: I11baf5094e96d33bc6be7f5f03d680f34cc1d026
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265266
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
2021-05-19 15:43:33 +00:00
Andrea Cirulli 3f057e9c0c fix jenkins files linter issues
Fix linter issues related to variable name, space after closing bracket.

refs DE-690
flag = none

test-plan:
- Build passes
- QA build with spec change executes fsc stage

Change-Id: I6f985fb3dfa8627703a27325b1eb25fae4585505
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265188
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-05-18 18:58:33 +00:00
Andrea Cirulli 67d6ccc360 fix jenkins file linter issues autofixable
refs DE-690
flag = none

test-plan:
- Build passes

Change-Id: Ie748a1e585ce8e3ec4978c7a5faa45dab524a905
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265184
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-05-18 16:48:15 +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
Kyle Rosenbaum 531eda2a12 add RSPEC_PROCESSES to contract_tests
refs DE-467

this change will require a followup to remove
DOCKER_PROCESSES

test plan:
-run linters
-linters use expected db on a per thread basis

Change-Id: Ie0fee7d22a335899e6dac5490f4cadf567e4e32f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/264294
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-05-10 21:10:47 +00:00
Kyle Rosenbaum 1e43e05241 add podTemplate and container definition to all applicable stages
refs DE-558, DE-582

[use-kubernetes]
[canvas-builds-refspec=24d3d83e8034ac6ad5380936498e1dcf01ab50eb]

modify the existing nodeRequirements to add podTemplate and
container definitions. initially, the podTemplate to be used
is docker-in-docker. the "use-kubernetes" flag must be set
as well.

test plan:
- build executes on k8s nodes in EKS when "use-kubernetes"
flag is set.
- build executes on EC2 when "use-kubernetes" flag is not set.

Change-Id: I13c68e5420bbf414532518eaf69ac82f9310bfbf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263257
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-04-27 19:47:25 +00:00
Kyle Rosenbaum 16469f7cfa add support for EKS container to protectedNode requirements
refs DE-558, DE-582

[canvas-builds-refspec=f9c80c0ac4b80de60ac50633523e30d5c2eb28b1]

modify the existing nodeRequirements call to pass a Map containing
the label as well as the possibility of container or podTemplate
params. this change only modifies the existing nodeRequirements to
continue using EC2 agents, not EKS.

test plan:
- builds still work as expected acquiring nodes

Change-Id: I0458a13a4c85e37aeb2f5dc56347e27101705646
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263208
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: Aaron Ogata <aogata@instructure.com>
2021-04-20 21:51:16 +00:00
Aaron Ogata b7b9d8cc4d remove redundant node clean-up code
refs DE-338

The protectedNode() function now handles automatic cleanup before / after a node is used, so much of the code here can be removed.

Test Plan:
1. Main build passes, FSC passes

[canvas-builds-refspec=81cc926fe89d6efd9f604d0c573630318fb4eb86]

Change-Id: Ie21d242aabe9826353f05149abb304a85223cebc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263149
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-04-19 16:37:23 +00:00
Aaron Ogata 5d1fb9b734 convert on*Result -> onStageEnded
refs DE-628

Test Plan:
1. Build summary report works for sub-jobs and normal stages
2. Sub-jobs run cleanupFn

[canvas-builds-refspec=82ccf7ae185871e45c658f225cc664ef05cda74d]

Change-Id: I9d4476b75e6488bcc388a89e9f7cf87150d0ae6d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262951
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-04-15 13:54:20 +00:00
Aaron Ogata 3027dcdbd7 rename handler to hooks
refs DE-628

[canvas-builds-refspec=a5aca2425b1f885f5fcb4298479c0081d73065ff]

Change-Id: I0581d820fc521fb4857c04a28804be1c9a2d19a5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262947
Reviewed-by: Kyle Rosenbaum <krosenbaum@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-04-14 22:50:58 +00:00
Aaron Ogata b3f6ee3b54 fix allow-stages directive
refs DE-621

Change-Id: I77e620defe993e37425cfd1f6e9c78d2574fb922
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262904
Reviewed-by: Kyle Rosenbaum <krosenbaum@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-04-14 17:37:00 +00:00
Aaron Ogata 1a2b0052f1 convert extendedStage -> protectedNode to nodeRequirements() pattern
refs DE-621

Make the stage configuration aware of its node requirements for future EKS support and allowing nospot to be removed.

Test Plan:
1. RSpec / Selenium build works
2. Contract Tests works
3. JS works
4. FSC works
5. Vendored Gems works

[canvas-builds-refspec=480f3570a6a6ebee5cedaecbb3a089476a008215]

Change-Id: I6cb63df20abe8c1f913db4f1b21bb01bd4d30312
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262898
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-04-14 15:23:01 +00:00
Aaron Ogata ab8603bb88 remove cleanupFn usage from contract tests job
refs DE-624

As part of making extendedStage() aware of stage node requirements, we need to remove consumers of the cleanupFn() functionality and replace them with extendedStage() compatible patterns.

Test Plan:
1. Contract Tests behaves correctly

Change-Id: Ic117622c764c2e29b7054f5380312663cda96b80
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262825
Reviewed-by: Kyle Rosenbaum <krosenbaum@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-04-13 21:11:10 +00:00
Aaron Ogata e18887bf26 move docker cleanup to protectedNode() handler
refs DE-624

As part of making extendedStage() aware of stage node requirements, we need to remove consumers of the cleanupFn() functionality and replace them with extendedStage() compatible patterns.

Test Plan:
1. All stages execute correctly

[canvas-builds-refspec=07f1a75ee23f8f6a9a1bbe062316373b761e7a30]

Change-Id: Ica11b78ebead5c9239dea112677a077654c7090d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262814
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: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-04-13 18:02:41 +00:00
Aaron Ogata 28454e524d work around flakey starlord token issue
refs DE-579

Change-Id: I0889b9e34c27a667ffa0573982bb77a37f103dc3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261023
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-03-18 18:20:52 +00:00
Brian Watson 6651cd10fe Remove public contract tests
We found that the external pact broker hasn't been used in over 2 years,
so there isn't a justifiable reason to keep these running

Test-plan:
- Verify that contract tests still run for internal customers
- Verify that post-merge, generated contracts are still pushed
   to the broker

Change-Id: I8221dbf97eb78610ef2b25a69e32909b7f29b6c6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260350
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
2021-03-10 19:41:39 +00:00
Kyle Rosenbaum a4e1da3aea add the ability to run parallel rspec processes in container
refs DE-225
flag=none

By specifying RSPEC_PROCESSES, we can now run multiple
rspec processes in a single container. This change modifies
the existing database setup to create 1 database per rspec
process. This also impacts results.xml using a 1 results.xml
per rspec process.

Rename database key to db for redis configurations to match
current version of redis.

test plan:
- rspec runs as expected in single threaded mode
- rspec runs as expected in multi threaded mode
- results.xml contains valid results with no duplciate tests
- reruns only run for failing threads
- reruns work in single and multithreaded mode

Change-Id: Ib2e549d467e8a6d8fef9914f2733d9ddfa460e99
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255120
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-01-14 21:12:45 +00:00
Aaron Ogata 3e92cc4498 move execute function under libraryScript
refs DE-442

[canvas-builds-refspec=eecea52ff75a74be10cd0d2c1434dc917bd726af]

Change-Id: I7412d590e1c08a47eb48b1fd82af9eaf0d5eb145
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256507
Reviewed-by: Kyle Rosenbaum <krosenbaum@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-01-12 00:32:08 +00:00
Andrea Cirulli 4d672c2f6a add global timeout and reevaluate all timeouts
Add timeout to all builds and set the proper values for the existing
timeouts

refs DE-307
flag = none

test-plan:
- Force the build to timeout and check that jenkins fails the build

Change-Id: I2e3ae36f828da1bc047bf5a2cfbc79c167b84d5f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256171
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-01-11 21:24:03 +00:00
Alex Slaughter 266a694102 Revert "skip Quiz LTI contract tests"
This reverts commit 5db206b722.

Reason for revert: No longer needed

closes QUIZ-8109

Change-Id: I9496031c18b5904b77ab7cd77d42a389202b35f4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256481
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
2021-01-11 20:46:08 +00:00
Aaron Ogata 5db206b722 skip Quiz LTI contract tests
refs QUIZ-8109

Change-Id: I2debd5dcbc159b2097248ff66195c8caf8cc9680
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256297
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-01-08 06:39:21 +00:00
James Butters cc45c56cb3 always checkout master code
we want to always checkout master code for testing on jenkins, unless
there are changes to our build scripts then pull the gerrit refspec.

flag = none

Test Plan:
- Normal Jenkins build passes.
- changes to docker-compose.new-jeknins* causes sub builds
  to checkout code from gerrit refspec.
- changes to any file in build/new-jenkins/ causes sub
  builds to checkout code from gerrit refspec.
- Normal build with no changes to Jenkinsfile*, build/new-jenkins/,
  or docker-compose.new-jenkins* sub builds checkout master.

Change-Id: If1224a44b52b00f0f056b9552cd562809fc7eaa8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252999
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-11-18 21:48:19 +00:00
Andrea Cirulli ba4ad02c38 abstract checkout code in jenkinsfiles
refs DE-351
flag = none

test-plan:
- Build passes
- Test FSC is working

Change-Id: Id3844dd12600e5d3a80d267bf67916c4d43d2548
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251743
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2020-11-04 20:58:00 +00:00
James Butters 986c935bdf checkout Jenkinsfile from master
These changes need to be accompanied by changes
to Jenkins config:
  - main-canvas-postgres-12-ruby-2.6 and
  main-canvas-postgres-12-ruby-2.6-postmerge, SCM
  refspec changed to master
  - sub-builds scm changed from canvas-lms-refspec
  to JENKINSFILE_REFSPEC defaulting to master
  - add Jenkins parameter JENKINSFILE_REFSPEC to sub-builds
  - add new Jenkins build for main Jenkinsfile changes
  - main build don't trigger on Jenkinsfile changes using
    forbidden path.

Testing once merged:
- verify builds without Jenkinfile changes pull the master
  version of Jenkinsfile
  - verify sub-builds as well
- verify gerrit with Jenkinsfile changes triggers new build
  - verify sub-builds get Jenkinsfiles from gerrit not master
  - test a combination of Jenkinsfiles, not just the main one
  - verify main build is not triggered
- run a plugin build without canvas-lms-refspec
- run a plugin build with canvas-lms-refspec

Change-Id: Ic6be8b446f80d57f7b0f25c77e6cffb959e03236
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251634
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
2020-11-03 03:08:08 +00:00
Aaron Ogata 2dcc3df114 introduce canvas-builds-refspec commit flag
refs DE-349

[canvas-builds-refspec=f04c7902ccabadb61cee13fa93f09b1184925b84]

Test Plan:
1. Build pulls master when flag does not exist
2. Build pulls specified commit when flag exists
3. Build pulls master for post-merge when flag exists

Change-Id: I365efd3a305d08f7a3df76fd44799756104b4c1f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251635
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-11-02 19:33:54 +00:00
Aaron Ogata c12b04835a report contract test errors to Jenkins
refs DE-149

Change-Id: I2732c1f003cd36a5b370646cb2b35ab37c883e60
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246064
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-08-31 19:36:54 +00:00
Brian Watson 0cb4e6418f Push canvas-as-a-consumer http contracts to pact broker
flag=none
closes OUT-3903

Note: Pact and FSC don't play nicely when generating contracts
since Pact thinks that a new FSC run of a request+state pair
is trying to override something unintentionally

FSC_REPEAT_FACTOR='1'

Test-plan
 - verify that contract tests run
 - (post-merge): verify that contracts are pushed to inseng broker

Change-Id: Ic856bf6b506a00a921e9b1dd6add6dc1bdd105bd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246265
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
2020-08-31 17:49:08 +00:00
Aaron Ogata 4b796a818e restore junit parallel uploads
refs DE-219

Test Plan:
Run the build several times and ensure the test count is consistent

Change-Id: Id773ef534efa4514543596fdc53bac565a5bd349
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245762
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
2020-08-24 14:37:28 +00:00
James Butters 89bc0fa2e0 iterate through xmls for junit upload
seems to be a bug with jekins uploading bulk of junit xmls, iterating
through the xmls and uploading one by one gives an accurate junit
report.

closes: DE-171
flag = none

Test Plan:
  -Compare mulitple test runs for consistent test count

Change-Id: I7fef862bfcce00e2f60458c6c8c3fbe713b3d39c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244199
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-08-04 20:54:01 +00:00
Aaron Ogata 3c8327de70 protect contract-tests against spot instance failures
refs DE-139

[skip-docker-build]

Test Plan:
1. Ensure job passes with 0 node removals
2. Ensure job retries upon node removal
3. Ensure job runs finally / clean-up block(s) correctly
4. Ensure job runs finally / clean-up block(s) correctly upon failure

Change-Id: I241d5faa778aa7e28d0d54c2b3650bb05e593da0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243252
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: Aaron Ogata <aogata@instructure.com>
2020-07-24 16:38:09 +00:00
Rex Fleischer c5c3820042 use shared library for configuration
fixes: CCI-389

Test-Plan:
we need to run all the builds that we can for this:
- the current build needs to pass
- main-for-plugins needs to be ran
- master-bouncer
- dive?
- translations

Change-Id: Iae7f9dad7668b90653a0b9a8edc20ec69fa109c3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240345
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ryan Norton <rnorton@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2020-06-18 18:36:49 +00:00
James Butters a73851216b junit reports for contract tests
closes: CCI-387
flag = none

Change-Id: I7149a881278bcbb028f6f92c6319123723f64315
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240463
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-06-18 13:30:07 +00:00
James Butters 18862fdf0e spec: revert pact scripts in bin/ to use web
pact scripts in bin/ are for local runs of pact and need to
use web container, new files that are in build/new-jenkins
don't need the check if Jenkins.

flag = none

Change-Id: I878b157b9856f1c25e160d7608b226f7185974a3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237520
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
2020-05-15 19:47:55 +00:00
August Thornton b67d8f02ab improve Pact build times in Jenky
closes USERS-523
flag = none

test plan:
 * builds should pass

Change-Id: Id34d85e58f6dc693b8a6ffca37d08d838562daec
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235344
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: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2020-05-15 15:35:24 +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 0f40402dfb Add timestamps to all builds
Closes: CCI-368

flag = none

Test Plan:
- All builds now have timestamps in the logs

Change-Id: I76f6b329c1b7f04511c6f63643964d6ccc8aa350
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236719
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Jacob Powell <spowell@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-05-08 22:20:37 +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 68d03c9e94 Add verbose flags to builds
Closes: CCI-248
flag = none

Test Plan: builds pass

Change-Id: Ia0421d4036eb1655a10497363e0327779c69746b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229446
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
2020-03-18 13:41:00 +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
James Butters 871c46f6c0 remove pulling cached images from contract-tests
flag = none

Change-Id: Iaf61e35ca0a99f0ea246bd1f2bdec0fad27cc6f0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/222627
Reviewed-by: Jacob Powell <spowell@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@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-01-09 20:51:52 +00:00
Rex Fleischer 4e2ce175d8 allow the docker-cleanup script to fail
fixes: CCI-151

flag = none

Test-Plan:
make sure it runs through the pipeline correctly

Change-Id: Ib1b76010b8122dcb76d9f257a1f2d674f6afc2c1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220247
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: Rex Fleischer <rfleischer@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2019-12-12 16:26:24 +00:00
Rex Fleischer 84cb85fdd7 add cleanup to jenkinsfiles
fixes: CCI-148

flag = none

Test-Plan:
look through the logs on each build and ensure the pre-clean runs

Change-Id: I1e10ab43deeb4dbcaa7b9c4f08ea3737675ebdf4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220000
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2019-12-10 17:14:57 +00:00
James Butters e08fceccbc spec: trigger contract-tests builds and propagate results
closes: CCI-124
Change-Id: I9868eeb09686fe7d29ad80c78863f09636c2b3de
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218716
Reviewed-by: S. Jacob Powell <spowell@instructure.com>
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-12-02 21:12:17 +00:00
Cameron Matheson f160c628f8 spec: publish live-events contract test results
closes CORE-3316

Change-Id: If50145e07b8538d7804319738da560c07a96534c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/212037
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-11-07 16:30:26 +00:00
Cameron Matheson 41fbbab781 fix stage name
Change-Id: Iae8bff538b674120d0c1e023b3368efc888a0d70
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/214538
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:09 +00:00
Cameron Matheson 73ebef3123 live events contract tests
closes CORE-3315

Change-Id: Ia5627387ecf8eac5deae4b84526b632ad61a9ad6
Reviewed-on: https://gerrit.instructure.com/210450
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-09-24 19:56:13 +00:00