From db2928e92dc8c002fa5d4903a2209ccc372bfa56 Mon Sep 17 00:00:00 2001 From: Alex Koch Date: Thu, 22 Jan 2026 13:12:43 -0600 Subject: [PATCH 1/4] run tests in GHA --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..35425e3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + ruby-version: + - '3.3' + - '4.0' + + steps: + - uses: actions/checkout@v4 + + - name: set up ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + + - name: rspec + run: bundle exec rspec From 4a6f9982a79cad6295cdb8aa76060103c3dd8235 Mon Sep 17 00:00:00 2001 From: Alex Koch Date: Thu, 22 Jan 2026 13:14:44 -0600 Subject: [PATCH 2/4] fix existing test failures --- spec/client_spec.rb | 5 +++-- spec/support/api_responses.rb | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/spec/client_spec.rb b/spec/client_spec.rb index 5447711..3ff75f6 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -338,6 +338,7 @@ mock_request(OneRoster::CLASSES_ENDPOINT, classes_response) mock_request(OneRoster::COURSES_ENDPOINT, courses_response) mock_request(OneRoster::ACADEMIC_SESSIONS_ENDPOINT, terms_response) + mock_request(OneRoster::SCHOOLS_ENDPOINT, schools_response) end context 'without course_codes passed in' do @@ -355,8 +356,8 @@ expect(first_classroom.course_number).to eq(course_1['courseCode']) expect(first_classroom.period).to eq('1') expect(first_classroom.grades).to eq(class_1['grades']) - expect(first_classroom.tenant_id).to eq(class_1['tenant_id']) - expect(first_classroom.school_id).to eq(class_1['school_id']) + expect(first_classroom.tenant_id).to eq(school_1.dig('parent', 'sourcedId')) + expect(first_classroom.school_uid).to eq(class_1.dig('school', 'sourcedId')) expect(first_classroom.subjects).to eq([]) expect(first_classroom.term_name).to eq('term name') expect(first_classroom.term_start_date).to eq('2019-08-21') diff --git a/spec/support/api_responses.rb b/spec/support/api_responses.rb index 38ca371..095082f 100644 --- a/spec/support/api_responses.rb +++ b/spec/support/api_responses.rb @@ -253,8 +253,7 @@ 'grades' => %w(04 05), 'junk' => 'data', 'terms' => [{ 'sourcedId' => '1' }], - 'tenant_id' => 'tenant_id', - 'school_id' => 'school_id' + 'school' => { 'sourcedId' => 'school_id' } } end @@ -344,6 +343,22 @@ OneRoster::Response.new(stub(body: courses_body, status: status, env: stub(url: courses_response_url), headers: {})) end + #################################### SCHOOLS RESPONSE ##################################### + let(:school_1) do + { + 'sourcedId' => 'school_id', + 'name' => 'Test School', + 'identifier' => 'TS001', + 'parent' => { 'sourcedId' => 'tenant_id' } + } + end + + let(:schools_response_url) { stub(path: OneRoster::SCHOOLS_ENDPOINT) } + let(:schools_body) { { 'orgs' => [school_1] } } + let(:schools_response) do + OneRoster::Response.new(stub(body: schools_body, status: status, env: stub(url: schools_response_url), headers: {})) + end + ################################### PAGINATION RESPONSE ################################### let(:page_1_response) do OneRoster::Response.new( From 2a80a8d62c5fe0a9053eca7ae8151afab73695cb Mon Sep 17 00:00:00 2001 From: Alex Koch Date: Thu, 22 Jan 2026 13:17:40 -0600 Subject: [PATCH 3/4] add bundler-cache config to setup-ruby step --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35425e3..335b692 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true - name: rspec run: bundle exec rspec From 78db04afa766cfd62e70ec3439e64bd1ebf1be90 Mon Sep 17 00:00:00 2001 From: Alex Koch Date: Thu, 22 Jan 2026 13:19:30 -0600 Subject: [PATCH 4/4] ruby 3.4 only --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 335b692..c1fa683 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,7 @@ jobs: strategy: matrix: ruby-version: - - '3.3' - - '4.0' + - '3.4' steps: - uses: actions/checkout@v4