pre-generate schema to avoid spec timeouts

all graphql specs were timing out on their first run :|

Change-Id: I28e797f78524a7200d7cb2671501f133d3483a4d
Reviewed-on: https://gerrit.instructure.com/187011
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
This commit is contained in:
Cameron Matheson 2019-03-26 15:56:01 -06:00
parent 8658871eec
commit 1fbcba4500
40 changed files with 62 additions and 27 deletions

View File

@ -0,0 +1,23 @@
#
# Copyright (C) 2019 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
require_relative "../helpers/graphql_type_tester"
# building the schema is currently very slow.
# this ensures the schema is built before specs are run to avoid timeouts
CanvasSchema.graphql_definition

View File

@ -17,6 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
require_relative "./graphql_spec_helper"
describe "legacyNode" do
before(:once) do

View File

@ -17,6 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
require_relative "../graphql_spec_helper"
describe Mutations::CreateGroupInSet do
before(:once) do

View File

@ -17,6 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require_relative "../graphql_spec_helper"
describe Mutations::CreateSubmissionComment do
before(:once) do

View File

@ -17,6 +17,7 @@
#
require "spec_helper"
require_relative "../graphql_spec_helper"
describe Mutations::HideAssignmentGradesForSections do
let(:assignment) { course.assignments.create! }

View File

@ -17,6 +17,7 @@
#
require "spec_helper"
require_relative "../graphql_spec_helper"
describe Mutations::HideAssignmentGrades do
let(:assignment) { course.assignments.create! }

View File

@ -17,6 +17,7 @@
#
require "spec_helper"
require_relative "../graphql_spec_helper"
describe Mutations::PostAssignmentGradesForSections do
let(:assignment) { course.assignments.create! }

View File

@ -17,6 +17,7 @@
#
require "spec_helper"
require_relative "../graphql_spec_helper"
describe Mutations::PostAssignmentGrades do
let(:assignment) { course.assignments.create! }

View File

@ -17,6 +17,7 @@
#
require "spec_helper"
require_relative "../graphql_spec_helper"
describe Mutations::SetAssignmentPostPolicy do
let(:assignment) { course.assignments.create! }

View File

@ -17,6 +17,7 @@
#
require "spec_helper"
require_relative "../graphql_spec_helper"
describe Mutations::SetCoursePostPolicy do
let(:assignment) { course.assignments.create! }

View File

@ -17,6 +17,7 @@
#
require_relative "../../spec_helper"
require_relative "../graphql_spec_helper"
describe Mutations::SetOverrideScore do
let!(:account) { Account.create! }

View File

@ -17,7 +17,7 @@
#
require "spec_helper"
require "helpers/graphql_type_tester"
require_relative "../graphql_spec_helper"
require 'set'
describe Mutations::UpdateAssignment do

View File

@ -17,7 +17,7 @@
#
require "spec_helper"
require "helpers/graphql_type_tester"
require_relative "../graphql_spec_helper"
describe Mutations::UpdateAssignment do
before do

View File

@ -17,6 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
require_relative "./graphql_spec_helper"
describe "graphql pg statement_timeouts" do
before(:once) do

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
require File.expand_path(File.dirname(__FILE__) + "/../../helpers/graphql_type_tester")
require_relative "../graphql_spec_helper"
describe Types::AssignmentGroupType do
context "AssignmentGroup" do

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
require File.expand_path(File.dirname(__FILE__) + "/../../helpers/graphql_type_tester")
require_relative "../graphql_spec_helper"
describe Types::AssignmentType do
let_once(:course) { course_factory(active_all: true) }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::CoursePermissionsType do
let_once(:course) { course_with_student(active_all: true); @course }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::CourseType do
let_once(:course) { course_with_student(active_all: true); @course }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::DiscussionType do
let_once(:discussion) { group_discussion_assignment }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::EnrollmentType do
let_once(:enrollment) { student_in_course(active_all: true) }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::ExternalToolType do
let_once(:course) { course_with_teacher(active_all: true); @course }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::ExternalUrlType do
let_once(:course) { course_with_teacher(active_all: true); @course }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::FileType do
let_once(:course) { course_with_teacher(active_all: true); @course }

View File

@ -17,7 +17,7 @@
#
require_relative '../../spec_helper'
require_relative '../../helpers/graphql_type_tester'
require_relative "../graphql_spec_helper"
describe Types::GradesType do
let!(:account) { Account.create! }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::GroupSetType do
before(:once) do

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::GroupType do
before(:once) do

View File

@ -16,7 +16,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
describe Types::MediaObjectType do

View File

@ -16,7 +16,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
describe Types::MediaSourceType do

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::ModuleExternalToolType do
let_once(:course) { course_with_teacher(active_all: true); @course }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::ModuleItemType do
let_once(:course) { course_with_teacher(active_all: true); @course }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::ModuleType do
let_once(:course) { course_with_student(active_all: true); @course }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::PageType do
let_once(:course) { course_with_teacher(active_all: true); @course }

View File

@ -17,7 +17,7 @@
#
require "spec_helper"
require_relative "../../helpers/graphql_type_tester"
require_relative "../graphql_spec_helper"
describe Types::PostPolicyType do
let(:assignment) { course.assignments.create! }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::ProgressType do
before(:once) do

View File

@ -17,6 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require_relative "../graphql_spec_helper"
describe Types::QueryType do
it "works" do

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::QuizType do
let_once(:quiz) { quiz_model }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::SectionType do
let_once(:course) { course_with_student(active_all: true); @course }

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::SubmissionCommentType do
before(:once) do

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::SubmissionType do
before(:once) do

View File

@ -17,7 +17,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/graphql_type_tester')
require_relative "../graphql_spec_helper"
describe Types::UserType do
before(:once) do