Skip to content

Commit de957fb

Browse files
committedMar 19, 2025
resolve attempt for editor.spec flakiness
1 parent 4cae3d4 commit de957fb

File tree

4 files changed

+38
-77
lines changed

4 files changed

+38
-77
lines changed
 

‎.github/workflows/ci.yml

+30-74
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,11 @@ on:
55

66
jobs:
77
CI:
8-
name: Monorepo CI flow
8+
name: Editor Tests Flakiness Check
99
runs-on: ubuntu-latest
1010

1111
steps:
1212
- uses: actions/checkout@v4
13-
with:
14-
submodules: "recursive"
15-
16-
- uses: actions/setup-java@v4
17-
with:
18-
java-version: "17"
19-
distribution: "temurin"
20-
cache: maven
21-
22-
- name: Build QuestDB
23-
run: mvn clean package -f packages/browser-tests/questdb/pom.xml -DskipTests -P build-binaries
24-
25-
- name: Extract QuestDB
26-
run: tar -xzf packages/browser-tests/questdb/core/target/questdb-*-rt-linux-x86-64.tar.gz -C tmp/
27-
28-
- name: Create DB Root
29-
run: mkdir tmp/dbroot
30-
31-
- name: Start QuestDB
32-
run: ./tmp/questdb-*-rt-linux-x86-64/bin/questdb.sh start -d ./tmp/dbroot
33-
env:
34-
QDB_DEV_MODE_ENABLED: "true"
3513

3614
- uses: actions/setup-node@v4
3715
with:
@@ -47,57 +25,35 @@ jobs:
4725
- name: Build @questdb/web-console
4826
run: yarn workspace @questdb/web-console run build
4927

50-
- name: Run bundle watcher on @questdb/web-console
51-
run: yarn workspace @questdb/web-console bundlewatch
52-
53-
- name: Run @questdb/web-console unit tests
54-
run: yarn workspace @questdb/web-console run test:prod
55-
56-
- name: Run browser-tests test - auth
57-
run: node packages/web-console/serve-dist.js & yarn workspace browser-tests test:auth
58-
59-
- name: Stop QuestDB
60-
run: ./tmp/questdb-*-rt-linux-x86-64/bin/questdb.sh stop
61-
62-
- name: Start QuestDB, set auth credentials
63-
run: ./tmp/questdb-*-rt-linux-x86-64/bin/questdb.sh start -d ./tmp/dbroot
64-
env:
65-
QDB_DEV_MODE_ENABLED: "true"
66-
QDB_HTTP_USER: "admin"
67-
QDB_HTTP_PASSWORD: "quest"
68-
69-
- name: Run browser-tests test
70-
run: yarn workspace browser-tests test
71-
72-
- name: Print Log Files
73-
if: success() || failure()
74-
run: cat tmp/dbroot/log/*
75-
76-
- name: Save QuestDB log on test failure
77-
if: failure()
78-
uses: actions/upload-artifact@v4
79-
with:
80-
name: questdb-log
81-
path: tmp/dbroot/log/*
28+
- name: Start web console server
29+
run: node packages/web-console/serve-dist.js &
30+
31+
- name: Run editor tests 10 times
32+
run: |
33+
for i in {1..10}; do
34+
echo "=== Running editor tests iteration $i ==="
35+
36+
# Stop and remove any existing container
37+
docker stop questdb || true
38+
docker rm questdb || true
39+
40+
# Start QuestDB with auth
41+
docker run -d --name questdb \
42+
-p 9000:9000 -p 9009:9009 \
43+
-e QDB_HTTP_USER=admin \
44+
-e QDB_HTTP_PASSWORD=quest \
45+
-e QDB_DEV_MODE_ENABLED=true \
46+
questdb/questdb:nightly
47+
48+
# Wait for QuestDB to be ready
49+
sleep 10
50+
51+
# Run the editor tests
52+
yarn workspace browser-tests test
53+
54+
echo "=== Completed iteration $i ==="
55+
done
8256
8357
- name: Stop QuestDB
8458
if: success() || failure()
85-
run: ./tmp/questdb-*-rt-linux-x86-64/bin/questdb.sh stop
86-
87-
- name: Publish @questdb/react-components to npm
88-
if: success() && github.ref == 'refs/heads/main'
89-
uses: JS-DevTools/npm-publish@v1
90-
with:
91-
token: ${{ secrets.NPM_TOKEN }}
92-
access: public
93-
check-version: true
94-
package: ./packages/react-components/package.json
95-
96-
- name: Publish @questdb/web-console to npm
97-
if: success() && github.ref == 'refs/heads/main'
98-
uses: JS-DevTools/npm-publish@v1
99-
with:
100-
token: ${{ secrets.NPM_TOKEN }}
101-
access: public
102-
check-version: true
103-
package: ./packages/web-console/package.json
59+
run: docker stop questdb || true

‎packages/browser-tests/cypress/commands.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,12 @@ Cypress.Commands.add("getMountedEditor", () =>
148148
Cypress.Commands.add("getEditor", () => cy.get(".monaco-editor[role='code'] "));
149149

150150
Cypress.Commands.add("getEditorContent", () =>
151-
cy.get(".monaco-editor textarea")
151+
cy
152+
.get(".monaco-editor")
153+
.should("be.visible")
154+
.find("textarea")
155+
.should("exist")
156+
.should("be.visible")
152157
);
153158

154159
Cypress.Commands.add("getEditorHitbox", () =>

‎packages/browser-tests/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"packageManager": "yarn@3.1.1",
44
"private": true,
55
"scripts": {
6-
"test": "cypress run --env failOnSnapshotDiff=false --env requireSnapshots=false --spec 'cypress/integration/console/*.spec.js'",
6+
"test": "cypress run --env failOnSnapshotDiff=false --env requireSnapshots=false --spec 'cypress/integration/console/editor.spec.js'",
77
"test:auth": "cypress run --env failOnSnapshotDiff=false --env requireSnapshots=false --spec 'cypress/integration/auth/*.spec.js'",
88
"test:enterprise": "cypress run --env failOnSnapshotDiff=false --env requireSnapshots=false --spec 'cypress/integration/enterprise/*.spec.js'",
99
"test:update": "yarn run test --env updateSnapshots=true"

‎packages/browser-tests/questdb

Submodule questdb updated 353 files

0 commit comments

Comments
 (0)
Failed to load comments.