Skip to content

Commit

Permalink
Merge pull request #1024 from ix5/flaky-tests
Browse files Browse the repository at this point in the history
docker, ci: Make e2e tests less flaky
  • Loading branch information
ix5 committed May 3, 2024
2 parents 16dce51 + 5084314 commit 98333e7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
# Docker will have its own cache of node packages and its own python venv
node_modules/
.venv/
# Prevent accidental inclusion:
comments.db
12 changes: 8 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ services:

# Isso server should always reflect production image
isso-server:
image: isso
image: isso:latest
container_name: isso-server
build:
context: .
dockerfile: Dockerfile
# No need to set entrypoint, image already provides CMD
#command: /isso/bin/isso -c /config/isso.cfg run
# No need to set command/entrypoint, image already provides both
# For reference:
#command: /isso/bin/isso run # standalone
# Using both ENTRYPOINT and CMD:
#entrypoint: /isso/bin/gunicorn -b 0.0.0.0:8080 -w 4 --preload --worker-tmp-dir /dev/shm
#command: isso.run
environment:
ISSO_SETTINGS: "/config/isso-dev.cfg"
ISSO_ENDPOINT: "http://isso-dev.local:8080"
Expand All @@ -37,7 +41,7 @@ services:
- isso-dev.local
- localhost
volumes:
- ./db:/db/
- ./db:/db/ # unused by default isso-dev.cfg
- type: bind
source: ./contrib/isso-dev.cfg
target: /config/isso-dev.cfg
Expand Down
12 changes: 8 additions & 4 deletions isso/js/tests/integration/puppet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ test("should fill Postbox with valid data and receive 201 reply", async () => {
]);

const expected = {
"id": expect.any(Number),
"id": 1,
"parent": null,
"created": expect.any(Number),
"modified": null,
Expand Down Expand Up @@ -204,8 +204,13 @@ test("should execute GET/PUT/POST/DELETE requests correctly", async () => {
{ waitUntil: 'load' }
);

await expect(page).toMatchElement(
'#isso-1 .isso-text',
{ text: 'A comment' },
);

// Relies on cookies from page.cookies, sent automatically
let postData = {
let putData = {
//id: 1,
text: 'New comment body',
author: 'Commenter #2',
Expand All @@ -217,7 +222,7 @@ test("should execute GET/PUT/POST/DELETE requests correctly", async () => {
let editHandler = request => {
let data = {
'method': 'PUT',
'postData': JSON.stringify(postData),
'postData': JSON.stringify(putData),
'headers': {
...request.headers(),
'Content-Type': 'application/json',
Expand Down Expand Up @@ -246,7 +251,6 @@ test("should execute GET/PUT/POST/DELETE requests correctly", async () => {
let deleteHandler = request => {
let data = {
'method': 'DELETE',
//'postData': JSON.stringify({id: 1}),
'headers': {
...request.headers(),
'Content-Type': 'application/json',
Expand Down

0 comments on commit 98333e7

Please sign in to comment.