-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test_site_convert |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test_site | ||
test_site_algolia_plugin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@ECHO off | ||
|
||
for /f "tokens=* delims=" %%a in (test_sites) do ( | ||
|
||
echo( | ||
echo Updating %%a | ||
|
||
node ../../index.js build %%a | ||
|
||
rmdir /s /q %%a\expected | ||
xcopy /e /y /i /q %%a\_site %%a\expected | ||
) | ||
|
||
for /f "tokens=* delims=" %%a in (test_convert_sites) do ( | ||
|
||
echo( | ||
echo Updating %%a | ||
|
||
node ../../index.js init %%a\non_markbind_site -c | ||
|
||
node ../../index.js build %%a\non_markbind_site | ||
|
||
rmdir /s /q %%a\expected | ||
xcopy /e /y /i /q %%a\non_markbind_site\_site %%a\expected | ||
|
||
rmdir /s /q %%a\_site | ||
rmdir /q %%a\non_markbind_site\_markbind | ||
rmdir /s /q %%a\non_markbind_site\_site | ||
del %%a\non_markbind_site\about.md %%a\non_markbind_site\index.md %%a\non_markbind_site\site.json | ||
) | ||
|
||
echo Updated all test sites | ||
exit /b %errorlevel% |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
for site in $(cat test_sites); | ||
do | ||
# print site name | ||
echo "Updating $site" | ||
|
||
# build site | ||
node ../../index.js build "$site" | ||
|
||
# replace the expected folder with the newly generated files | ||
rm -rf $site/expected | ||
cp -r $site/_site $site/expected | ||
done | ||
|
||
function cleanup_convert { | ||
# delete generated files | ||
rm -rf $site_convert/_site | ||
rm -rf $site_convert/non_markbind_site/_markbind $site_convert/non_markbind_site/_site | ||
rm -f $site_convert/non_markbind_site/about.md $site_convert/non_markbind_site/index.md "$site_convert"/non_markbind_site/site.json | ||
} | ||
|
||
for site_convert in $(cat test_convert_sites); | ||
do | ||
# print site name | ||
echo "Updating $site_convert test" | ||
|
||
# set cleanup trap | ||
trap cleanup_convert EXIT | ||
|
||
# convert site | ||
node ../../index.js init $site_convert/non_markbind_site -c | ||
|
||
# build site | ||
node ../../index.js build $site_convert/non_markbind_site | ||
|
||
# replace the expected folder with the newly generated files | ||
rm -rf $site_convert/expected | ||
cp -r $site_convert/non_markbind_site/_site $site_convert/expected | ||
|
||
# cleanup generated files | ||
cleanup_convert | ||
|
||
# remove trap | ||
trap - EXIT | ||
done | ||
|
||
echo "Updated all test sites" | ||
exit 0 |
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.
💥
☁️
😮