Skip to content
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

Merged
merged 3 commits into from
Oct 7, 2021

Conversation

katleiahramos
Copy link
Contributor

Small updates to TESTING.md instructions to include information about running tests in lib/ directory

* 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 |
Copy link
Contributor Author

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!

Copy link
Contributor

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
Comment on lines 13 to 14
* Shared and Lib directory
* Ruby tests - Unit tests over Ruby code in the shared and lib directory.
Copy link
Contributor

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

Copy link
Contributor Author

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 |
Copy link
Contributor

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
Comment on lines 64 to 70
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.
Copy link
Contributor

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

Suggested change
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

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated here: 4cb57af

Copy link
Contributor

@maddiedierker maddiedierker left a 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!

@katleiahramos katleiahramos merged commit 23b578c into staging Oct 7, 2021
@katleiahramos katleiahramos deleted the katleiah/update-testing-instructions-for-lib branch October 7, 2021 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants