Skip to content

Commit 6a98a46

Browse files
Make it easier to run RSPEC via docker compose
1 parent 846e868 commit 6a98a46

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/tmp/*
77
/coverage/*
88
/artifacts/*
9+
.cache/*
910

1011
/*.xml
1112
*.zip

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,19 @@ docker build -t alma-user-load .
118118
> rspec
119119
```
120120

121+
### Run the test suite via Docker:
122+
```sh
123+
# Run rspec:
124+
> docker compose run --rm shell bundle exec rspec
125+
126+
# Run a single spec file:
127+
> docker compose run --rm shell bundle exec rspec spec/lib/ucpath_spec.rb
128+
129+
# Run a specific test (by line number)
130+
> docker compose run --rm shell bundle exec rspec spec/lib/helpers_spec.rb:34
131+
```
132+
133+
121134
Note - to run the test suite you need to change the LDAP setting in your `.env` file
122135
> \# For testing:
123136
> LDAP_HOST=ldap.fake.edu
@@ -134,7 +147,6 @@ Note - to run the test suite you need to change the LDAP setting in your `.env`
134147

135148

136149
## Future Improvements:
137-
- Replace fixtures w/some sort of factory (VCR)
138150
- DRY things up (UCPath vs. SIS --> phone, email, address, names, etc...)
139151
- SIS - add run by user id (similar to how I setup ucpath)...if possible
140152
- Move 'create_user_record' from user.rb to a separate class

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,12 @@ services:
1313
- ./:/opt/app
1414
ports:
1515
- 3000:3000
16+
shell:
17+
build:
18+
context: .
19+
target: development
20+
init: true
21+
working_dir: /opt/app
22+
volumes:
23+
- ./:/opt/app
24+
entrypoint: []

0 commit comments

Comments
 (0)