-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update TESTING.md for running tests in lib directory #42857
Update TESTING.md for running tests in lib directory #42857
Conversation
* Pegasus directory | ||
* Ruby tests - Test server side logic, caching, graphics, etc. | ||
|
||
### When tests are run | ||
|
||
<!---- Can use http://markdowntable.com/ for reformatting help ---> | ||
|
||
| | ruby lint | scss lint | haml lint | JavaScript eslint (everywhere) | apps test | dashboard unit tests | UI tests (Chrome) | UI tests (all browsers) | eyes UI tests | pegasus unit tests | shared unit tests | | ||
| | ruby lint | scss lint | haml lint | JavaScript eslint (everywhere) | apps test | dashboard unit tests | UI tests (Chrome) | UI tests (all browsers) | eyes UI tests | pegasus unit tests | shared and lib unit tests | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can someone confirm this is true? haha that both shared and lib share run in circle CI and test build? Happy to update this to be more accurate if needed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, this is true!
TESTING.md
Outdated
* Shared and Lib directory | ||
* Ruby tests - Unit tests over Ruby code in the shared and lib directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "directory" should be "directories" now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated here: 4cb57af
* Pegasus directory | ||
* Ruby tests - Test server side logic, caching, graphics, etc. | ||
|
||
### When tests are run | ||
|
||
<!---- Can use http://markdowntable.com/ for reformatting help ---> | ||
|
||
| | ruby lint | scss lint | haml lint | JavaScript eslint (everywhere) | apps test | dashboard unit tests | UI tests (Chrome) | UI tests (all browsers) | eyes UI tests | pegasus unit tests | shared unit tests | | ||
| | ruby lint | scss lint | haml lint | JavaScript eslint (everywhere) | apps test | dashboard unit tests | UI tests (Chrome) | UI tests (all browsers) | eyes UI tests | pegasus unit tests | shared and lib unit tests | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, this is true!
TESTING.md
Outdated
Tests in the `shared/` and `lib/` directories need to be run slightly differently since they are outside of our Rails environment. | ||
|
||
`cd shared && ruby -Itest ./test/path/to/your/test.rb` will run the specified | ||
test file in the shared directory. | ||
|
||
`cd lib && ruby -Itest ./test/path/to/your/test.rb` will run the specified | ||
test file in the lib directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: i think we can simplify/deduplicate this for clarity. maybe something like
Tests in the `shared/` and `lib/` directories need to be run slightly differently since they are outside of our Rails environment. | |
`cd shared && ruby -Itest ./test/path/to/your/test.rb` will run the specified | |
test file in the shared directory. | |
`cd lib && ruby -Itest ./test/path/to/your/test.rb` will run the specified | |
test file in the lib directory. | |
Tests in the `shared/` and `lib/` directories are run slightly differently than `dashboard/` since they are outside of our Rails environment. To run a test file in either directory, `cd` into it before running the tests. Example: | |
```bash | |
cd shared | |
ruby -Itest ./test/path/to/your/test.rb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my suggestion got kind of messed up because there are nested code blocks 😢 this is the example code block i tried to write above (using bash for syntax highlighting):
cd shared
ruby -Itest ./test/path/to/your/test.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated here: 4cb57af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay, thank you for making these updates!
Small updates to TESTING.md instructions to include information about running tests in
lib/
directory