Wrap some things in a create_app function and add a basic setup for t… #81
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Simple test so I can sleep better | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| check_them_endpoints: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install env | |
| run: | | |
| sudo apt install nodejs npm && npm i -g html-validate | |
| pip install -r requirements.txt | |
| - name: Test the endpoints | |
| run: | | |
| ./cmd.sh run & | |
| sleep 2 | |
| curl -v "http://localhost:32168/comments?for=example" > out.html | |
| cat out.html | |
| html-validate out.html | |
| curl -v "http://localhost:32168/comments?for=example/deeper" > out.html | |
| cat out.html | |
| html-validate out.html | |
| curl -v "http://localhost:32168/comments?for=/example/deeper" > out.html | |
| cat out.html | |
| html-validate out.html | |
| # Create new comment. | |
| echo "::group::Creating comments..." | |
| curl -v -X POST "http://localhost:32168/comments?for=/example/deeper" \ | |
| -H "Content-Type: application/x-www-form-urlencoded" \ | |
| -d "for=deeper&comment_author=michal&comment_contact=jejku@wp.pl&comment='ble ble ble'" | |
| curl -v -X POST "http://localhost:32168/comments?for=/example/deeper" \ | |
| -H "Content-Type: application/x-www-form-urlencoded" \ | |
| -d "for=deeper&comment_author=bobek&comment_contact=noraczej@wp.pl&comment='nie nie nie'" | |
| cat comments/example/deeper/* | |
| echo "::endgroup::" |