-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add script to update expected folder for test sites #828
Conversation
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.
Tested it on Windows, works brilliantly. 👍
I got one request though, can update the maintainer's guide to mention about your new feature? Thanks! This part:
- Rebuild the test files.
# on Unix
$ npm run updatetest
# on Windows
> npm run updatetestwin
@yamgent Seems like you forgot to include a link :P EDIT: Ok wait I see what you did there 👍 You can ignore this comment haha |
@@ -0,0 +1,2 @@ | |||
test_site | |||
test_site_algolia_plugin |
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.
Screenshot of the current docs:
Given that we no longer have one ("the") test site, it would be great to also update the details of this new testing approach in our developer guide (in the Running tests
and Updating tests
sections). In particular, mentioning that whenever a new test site is added, its folder name will need to be added to this file.
9f68a56
to
4756e49
Compare
I am foreseeing that the changes for the Since #698 is a |
Sure, we can revisit this after #698 is merged! |
@marvinchin #698 is merged, you can continue with resolving conflict now. |
4756e49
to
9596ee0
Compare
I've updated the scripts after rebasing on top of master. If someone could re-test the windows implementation again to ensure that it still works, that would be great! @amad-person I made some changes to the implementation of Thanks everyone 🙂 |
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.
Just a minor nit. The site_convert
testing behaviour is working as intended in test.sh
! Thanks for this PR 😄
9596ee0
to
f5ae0d4
Compare
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.
LGTM; some ideas about phrasing and structure -
@@ -136,20 +136,41 @@ $ npm run test | |||
For Windows users: | |||
|
|||
``` | |||
$ npm run testwin | |||
> npm run testwin |
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.
💥
☁️
😮
docs/devGuide/devGuide.md
Outdated
> npm run updatetestwin | ||
``` | ||
<box type="warning"> | ||
You should always check that the output generated is correct before committing your changes to the expected site. |
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.
Let's standardize on "expected files" and "test sites"? :D So if you were to use both terms together, you would phrase it as Update the expected files in all the test sites
.
For this sentence, it might become something like: You should always check that the generated output is correct before committing any changes to the test sites.
docs/devGuide/devGuide.md
Outdated
|
||
##### New features | ||
|
||
Add new site content into the `test/test_site/` folder to demonstrate the new feature. Ensure that the new content is included in the test site so that your feature will be tested when `markbind build` is run on the test site. Remember to update the expected HTML files in `test/test_site/expected/`. | ||
Add new site content into an existing test site or create a new test site to demonstrate the new feature. Ensure that the new content is included in the test site so that your feature will be tested when `markbind build` is run on the test site. Remember to update the expected HTML files for the test site. |
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.
I feel like there's some repetition here. The special case of adding new site content / creating a new test site only applies when adding a new feature.
So maybe we can remove the Changes to existing features
section, and combine Simply / Remember to update the expected files...
with L144-146.
Say, something like:
#### Updating tests
Whether you are adding a new feature, updating existing features or fixing bugs, make sure to update the test sites to reflect the changes. You may use the following scripts to do this automatically:
[...]
#### When adding new features
Add new site content into an existing test site or create a new test site to demonstrate the new feature. This is to ensure that your feature can be tested by building that test site.
<box type"info">
When creating a new test site...
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.
Also, dropping the HTML
here because sometimes the non-HTML files get modified too
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.
Other than the documentation change suggestions by Kenneth, I got nothing else to add.
Declaration of test site directories are replicated across test.bat and test.sh. Let's move the declaration to a separate file and have the scripts obtain the directory names from the file instead.
The implementation of the bash and batch test script differs slightly. The batch script implementation allows multiple test convert sites, but the bash script implementation only allows a single test convert site. Let's update the bash script to allow it to be extensible to multiple test convert sites.
2689339
2689339
to
d5d4839
Compare
Developers have to update the expected folder for test sites by hand. Updating the expected folders for each site manually becomes especially unwieldy as the number of test sites increase. Let's have a script which automates the updating of expected folders in all of the test sites.
d5d4839
to
b01d932
Compare
Updated the documentation as per the comments. Thanks again for looking at it! |
Sorry, not sure what happened but the previous reviews seem to have been dismissed 🙁 |
b01d932
to
80f059b
Compare
Automatic dismissal of reviews via push is misrepresented in UI: isaacs/github#1157 |
docs/devGuide/devGuide.md
Outdated
$ npm run updatetest | ||
``` | ||
|
||
For Windows users: |
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.
Maybe standardize to "On Unix" and "On Windows" like you mentioned in the maintainer guide?
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.
Done!
The updatetest and updatetestwin scripts have been added for developers to update the expected output for all test sites. Also, testing instructions for the developer and maintainer guides assume that there is only one test site. Let's update the developer and maintainer guides to include usage instructions for the test site update scripts. Let's also generalize the testing instructions for multiple test sites.
80f059b
to
329b333
Compare
Understood the distress caused by this feature; I have disabled it, sorry! |
There was a bug in Otherwise, this PR has improved my quality of life when doing releases, and even indirectly spotted a bug, so nice job. 👍 |
Woohoo impacc 🎉 @marvinchin |
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [x] Other, please explain: workflow improvement
Resolves #761.
What is the rationale for this request?
Presently, developers have to update the expected output for the test sites by hand. As the number of test sites increase, rebuilding the test sites and updating the expected folders of each site becomes more unwieldy.
Being able to automatically updated the expected folders would help reduce the time spent on this process.
What changes did you make? (Give an overview)
update.sh
andupdate.bat
which rebuilds all test sites and updates their expected folders.Is there anything you'd like reviewers to focus on?
I don't have a Windows machine, so it would be great if a windows user can help to test both
test.bat
andupdate.bat
to ensure they are behaving as expected 🙂Testing instructions:
Run
npm run updatetest
ornpm run updatetestwin
. All test sites should be rebuilt, and the output in_site
should be copied over toexpected
.Proposed commit message: (wrap lines at 72 characters)
I've split the PR into 2 commits, each with their own commit message. Do let me know if I should change them!