Skip to content

Commit 587b3bd

Browse files
committed
try to tweak CI config
1 parent 824aee4 commit 587b3bd

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/rspec.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ on:
77

88
jobs:
99
rspec:
10-
runs-on: ubuntu-24.04
10+
runs-on: ubuntu-latest
1111
services:
1212
postgres:
1313
image: postgres:17
1414
env:
15+
POSTGRES_USER: postgres
1516
POSTGRES_PASSWORD: password
1617
ports:
1718
- 5432:5432
@@ -20,10 +21,9 @@ jobs:
2021
env:
2122
# Do not install production/staging-only gems in test environment
2223
BUNDLE_WITHOUT: "production staging"
24+
DB_HOST: localhost
2325
DB_USER: postgres
2426
DB_PASSWORD: password
25-
RAILS_ENV: test
26-
RUBY_ENV: test
2727
# TODO: This should not be required, but a few specs rely on it by using ENV.fetch.
2828
CANVAS_URL: https://ucberkeleysandbox.instructure.com
2929
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

.github/workflows/rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: RuboCop
1+
name: Checks
22

33
on:
44
push:
55
pull_request:
66
workflow_dispatch:
77

88
jobs:
9-
scan:
9+
brakeman:
1010
runs-on: ubuntu-latest
1111
env:
1212
# Do not install production/staging-only gems in test environment

app/controllers/courses_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ def show
3232
end
3333

3434
@assignments = if @role == 'student'
35-
Assignment.where(course_to_lms_id: course_to_lms.id, enabled: true).order(:name)
35+
Assignment.where(course_to_lms_id: course_to_lms.id, enabled: true).order(:name)
3636
else
37-
Assignment.where(course_to_lms_id: course_to_lms.id).order(:name)
37+
Assignment.where(course_to_lms_id: course_to_lms.id).order(:name)
3838
end
3939
render_role_based_view
4040
end

spec/rails_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
require 'spec_helper'
33
ENV['RAILS_ENV'] ||= 'test'
44

5+
# Ensure there is always a CANVAS_URL present.
6+
# This is somewhat of an anti-pattern.
7+
ENV['CANVAS_URL'] ||= 'https://ucberkeleysandbox.instructure.com'
8+
59
require_relative '../config/environment'
610

711
# Prevent database truncation if the environment is production

spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
# Exclude accessibility tests by default
3434
config.filter_run_excluding :a11y
3535

36+
config.before do
37+
# Ensure there is always a CANVAS_URL present.
38+
# This is somewhat of an anti-pattern.
39+
ENV['CANVAS_URL'] ||= 'https://ucberkeleysandbox.instructure.com'
40+
end
3641
# rspec-expectations config goes here. You can use an alternate
3742
# assertion/expectation library such as wrong or the stdlib/minitest
3843
# assertions if you prefer.

0 commit comments

Comments
 (0)