fix Markdown Preview flaky tests (#1879)
fix Markdown Preview flaky tests (#1879)

* Add service-to-service Node.js sample

* Add service-to-service Node.js sample

* Update run/authentication/auth.js

Co-Authored-By: Averi Kitsch <929f96130fbfd03604d45d132d2fe920796ae2ed@google.com>

* Update sample to address suggested changes

* Initial code added

* Updated package.json; resolved issues in auth.js from review

* Removed auth from branch

* Markdown renderer & editor added

* Markdown renderer & editor working

* Added xss sanitizer

* General cleanup

* Delete .gitignore

* Delete .gitignore

* Removed errant console.log

* Update markdown converter, general code cleanup

* updated README

* tests: added unit tests for editor & renderer

* added timeout

* tests: added editor & editor/render tests

* tests: added & modified test in package.json

* README: added env var

* Revert "README: added env var"

This reverts commit f43a2aff2681b214588986cd0298205c79e3ac30.

* README: added env var

* updated author email

* Update run/markdown-preview/README.md

Co-Authored-By: Averi Kitsch <929f96130fbfd03604d45d132d2fe920796ae2ed@google.com>

* add license to Dockerfile

* fixed json parsing error

* remove dependencies from root package.json

* remove xss (not needed)

* update node version in Dockerfile

* refactored code to reflect code review

* updated tests to respond to new code

* update packages.json

* run/markdown-preview: add sample

* update: syntax & grammar fixes

* change: throw error if markdown data absent from req

* change req.body validation

* fix syntax error

* change: fixed file name

* syntax: remove newline

* update: engine version

* syntax: general fixes

* code: replace json with plain text

* test: modified tests for accuracy

* syntax: minor fixes

* test: modified for new code

* added comment about xss

* code: unwrapped body.data

* test: updated tests per code review

* code: added timeout to got request

* test: updated with sinon & error message reading

* test: updated with sinon to read console log

* reformatted markdown declaration

* test: refactor to make valid tests

* Updated sample to use google-auth-library

* updated req.body conditional & markdown-it comment

* Removed init(); added Renderer url to /render

* Updated renderRequest client

* Updated get to be async

* Updated tests to reflect new code

* Removed erroneous comment & outdated env var

* Removed unused js package

* Added check for service url

* Updated service url in test/render

* Updated tests with urls & removed incorrect assertion

* updated POST request test

* updated POST request test

* removed 'then' from renderer test

* test modifications

* Reconfigured serviceUrl

* Removed sinon

* Updated region tags

* Updated valid request test

* Update: node 10 => node 12

* Added end to end tests

* Update run/markdown-preview/editor/test/system.test.js

Co-authored-by: Averi Kitsch <929f96130fbfd03604d45d132d2fe920796ae2ed@google.com>

* Added test to system.test.js

* Fixed npm test

* Fixed renderer test

* Updated shell permissions

* Updated cleanup func

* Update var exports

* Added service-name.sh

* Removed service-name.sh

* Move service.sh functions into runner.sh

* Added check for BASE_URL

* Fixed system.test env

* Add check for BASE_URL var

* Added id token

* Fixed test; removed allow-auth flag

* Added retry to http requests

* Updated timeout on Renderer test

* Removed all timeouts from tests

* Removed retry from render.js

Co-authored-by: Kelsey Krippaehne <c9646baea42901443de14b5f33ce788b84666c22@krippaehne-macbookair.roam.corp.google.com>
Co-authored-by: Averi Kitsch <929f96130fbfd03604d45d132d2fe920796ae2ed@google.com>
GoogleCloudPlatform/nodejs-docs-samples,GoogleCloudPlatform/nodejs-docs-samples,GoogleCloudPlatform/nodejs-docs-samples,GoogleCloudPlatform/nodejs-docs-samples