@openqa/cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +424 -0
- package/database/schema-v2.sql +152 -0
- package/database/schema.sql +62 -0
- package/dist/agent/index.js +1581 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/cli/index.js +1779 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/database/index.js +124 -0
- package/dist/database/index.js.map +1 -0
- package/install.sh +165 -0
- package/package.json +73 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Orka.js Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://orkajs.com/loutre-orka-qa.png" alt="OpenQA" width="180" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">OpenQA</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Autonomous QA Testing Agent - Thinks, codes, and executes tests like a senior QA engineer. Powered by Orka.js 🦦</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/openqa"><img src="https://img.shields.io/npm/v/openqa.svg" alt="npm version"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/openqa"><img src="https://img.shields.io/npm/dm/openqa.svg" alt="npm downloads"></a>
|
|
14
|
+
<a href="https://github.com/orka-js/openqa/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/openqa.svg" alt="license"></a>
|
|
15
|
+
<a href="https://orkajs.com"><img src="https://img.shields.io/badge/docs-orkajs.com-blue.svg" alt="documentation"></a>
|
|
16
|
+
<a href="https://discord.com/invite/DScfpuPysP"><img src="https://img.shields.io/badge/discord-join%20chat-7289da.svg" alt="discord"></a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
OpenQA is a **truly autonomous** QA testing agent that thinks, codes, and executes tests like a senior QA engineer. It analyzes your application, generates its own tests, creates custom agents, and continuously improves.
|
|
22
|
+
|
|
23
|
+
## ✨ Features
|
|
24
|
+
|
|
25
|
+
### 🧠 Autonomous Brain
|
|
26
|
+
### � Autonomous Brain
|
|
27
|
+
- **Self-thinking** - Analyzes your app and decides what to test
|
|
28
|
+
- **Self-coding** - Generates unit, functional, E2E, security, and regression tests
|
|
29
|
+
- **Self-improving** - Learns from results and adapts strategy
|
|
30
|
+
- **Dynamic Agents** - Creates specialized agents on-the-fly based on needs
|
|
31
|
+
|
|
32
|
+
### � Simple Configuration
|
|
33
|
+
- **Describe your SaaS** - Just provide name, description, and URL
|
|
34
|
+
- **Add directives** - Optional instructions to guide the agent
|
|
35
|
+
- **Connect repo** - Optional: clone and analyze your codebase
|
|
36
|
+
- **That's it!** - The agent figures out the rest
|
|
37
|
+
|
|
38
|
+
### 🔗 Git Integration
|
|
39
|
+
- **GitHub/GitLab** - Auto-detect merges on main branch
|
|
40
|
+
- **CI/CD Listener** - Trigger tests after successful deployments
|
|
41
|
+
- **Auto Issues** - Creates issues for critical bugs found
|
|
42
|
+
|
|
43
|
+
### 🧪 Test Generation
|
|
44
|
+
- **Unit Tests** - Isolated function/component tests
|
|
45
|
+
- **Functional Tests** - User workflow tests
|
|
46
|
+
- **E2E Tests** - Complete user journey tests
|
|
47
|
+
- **Security Tests** - SQL injection, XSS, auth bypass
|
|
48
|
+
- **Regression Tests** - Verify bug fixes
|
|
49
|
+
- **Performance Tests** - Load times, resource usage
|
|
50
|
+
|
|
51
|
+
## 🚀 Quick Start
|
|
52
|
+
|
|
53
|
+
### One-Line Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
curl -fsSL https://openqa.orkajs.com/install.sh | bash
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Configure Your SaaS (3 lines!)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Configure your application
|
|
63
|
+
curl -X POST http://localhost:3000/api/saas-config/quick \
|
|
64
|
+
-H "Content-Type: application/json" \
|
|
65
|
+
-d '{
|
|
66
|
+
"name": "My SaaS App",
|
|
67
|
+
"description": "E-commerce platform with user auth, product catalog, and checkout",
|
|
68
|
+
"url": "https://my-app.com"
|
|
69
|
+
}'
|
|
70
|
+
|
|
71
|
+
# Start autonomous testing
|
|
72
|
+
curl -X POST http://localhost:3000/api/brain/run
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**That's it!** OpenQA will:
|
|
76
|
+
1. Analyze your application
|
|
77
|
+
2. Generate appropriate tests
|
|
78
|
+
3. Create specialized agents as needed
|
|
79
|
+
4. Execute tests and report findings
|
|
80
|
+
5. Create GitHub issues for critical bugs
|
|
81
|
+
|
|
82
|
+
### Manual Installation
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git clone https://github.com/orka-js/openqa.git
|
|
86
|
+
cd openqa
|
|
87
|
+
npm install && npm run build
|
|
88
|
+
cp .env.example .env # Add your LLM API key
|
|
89
|
+
npm start
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 📖 Usage
|
|
93
|
+
|
|
94
|
+
### Start OpenQA
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Start in foreground (see logs)
|
|
98
|
+
openqa start
|
|
99
|
+
|
|
100
|
+
# Start in daemon mode (background)
|
|
101
|
+
openqa start --daemon
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Access Web Interfaces
|
|
105
|
+
|
|
106
|
+
Once started, open your browser:
|
|
107
|
+
|
|
108
|
+
- **DevTools**: http://localhost:3000 - Monitor agent activity in real-time
|
|
109
|
+
- **Kanban**: http://localhost:3000/kanban - View and manage QA tickets
|
|
110
|
+
- **Config**: http://localhost:3000/config - Configure OpenQA settings
|
|
111
|
+
|
|
112
|
+
### CLI Commands
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Check status
|
|
116
|
+
openqa status
|
|
117
|
+
|
|
118
|
+
# View logs
|
|
119
|
+
openqa logs
|
|
120
|
+
openqa logs --follow
|
|
121
|
+
|
|
122
|
+
# Configuration
|
|
123
|
+
openqa config list
|
|
124
|
+
openqa config get llm.provider
|
|
125
|
+
openqa config set saas.url https://your-app.com
|
|
126
|
+
|
|
127
|
+
# Stop agent
|
|
128
|
+
openqa stop
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## ⚙️ Configuration
|
|
132
|
+
|
|
133
|
+
### Environment Variables
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# LLM Configuration
|
|
137
|
+
LLM_PROVIDER=openai # openai, anthropic, or ollama
|
|
138
|
+
OPENAI_API_KEY=sk-xxx
|
|
139
|
+
ANTHROPIC_API_KEY=
|
|
140
|
+
OLLAMA_BASE_URL=http://localhost:11434
|
|
141
|
+
|
|
142
|
+
# Target SaaS Application
|
|
143
|
+
SAAS_URL=https://your-app.com
|
|
144
|
+
SAAS_AUTH_TYPE=none # none, basic, or session
|
|
145
|
+
SAAS_USERNAME=
|
|
146
|
+
SAAS_PASSWORD=
|
|
147
|
+
|
|
148
|
+
# GitHub Integration (Optional)
|
|
149
|
+
GITHUB_TOKEN=ghp_xxx
|
|
150
|
+
GITHUB_OWNER=your-username
|
|
151
|
+
GITHUB_REPO=your-repo
|
|
152
|
+
|
|
153
|
+
# Agent Behavior
|
|
154
|
+
AGENT_INTERVAL_MS=3600000 # 1 hour between test sessions
|
|
155
|
+
AGENT_MAX_ITERATIONS=20 # Max actions per session
|
|
156
|
+
AGENT_AUTO_START=true # Start testing automatically
|
|
157
|
+
|
|
158
|
+
# Web UI
|
|
159
|
+
WEB_PORT=3000
|
|
160
|
+
WEB_HOST=0.0.0.0
|
|
161
|
+
|
|
162
|
+
# Database
|
|
163
|
+
DB_PATH=./data/openqa.db
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Web-based Configuration
|
|
167
|
+
|
|
168
|
+
Prefer using the web interface at http://localhost:3000/config for easier configuration.
|
|
169
|
+
|
|
170
|
+
## 🧠 How the Brain Works
|
|
171
|
+
|
|
172
|
+
### The Thinking Loop
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
┌───────────┐ ┌───────────┐ ┌───────────┐
|
|
176
|
+
│ ANALYZE │ →→→ │ THINK │ →→→ │ ACT │
|
|
177
|
+
└───────────┘ └───────────┘ └───────────┘
|
|
178
|
+
│ │ │
|
|
179
|
+
│ │ │
|
|
180
|
+
└──────────────────┴──────────────────┘
|
|
181
|
+
LEARN
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
1. **ANALYZE** - Understands your app (description, URL, code if available)
|
|
185
|
+
2. **THINK** - Decides what tests are needed, what agents to create
|
|
186
|
+
3. **ACT** - Generates tests, creates agents, executes tests
|
|
187
|
+
4. **LEARN** - Reviews results, adjusts strategy, repeats
|
|
188
|
+
|
|
189
|
+
### What It Generates
|
|
190
|
+
|
|
191
|
+
| Test Type | Description | Example |
|
|
192
|
+
|-----------|-------------|----------|
|
|
193
|
+
| **Unit** | Isolated function tests | `test_validateEmail()` |
|
|
194
|
+
| **Functional** | User workflow tests | `test_loginFlow()` |
|
|
195
|
+
| **E2E** | Complete journeys | `test_purchaseCheckout()` |
|
|
196
|
+
| **Security** | Vulnerability tests | `test_sqlInjection()` |
|
|
197
|
+
| **Regression** | Bug fix verification | `test_issue123_fix()` |
|
|
198
|
+
| **Performance** | Speed/load tests | `test_pageLoadTime()` |
|
|
199
|
+
|
|
200
|
+
### Dynamic Agent Creation
|
|
201
|
+
|
|
202
|
+
The Brain creates specialized agents based on what it discovers:
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
🧠 Brain: "I see this app has a checkout flow. Let me create a specialist."
|
|
206
|
+
↓
|
|
207
|
+
🤖 Creates: "Checkout Flow Tester" agent with custom prompt
|
|
208
|
+
↓
|
|
209
|
+
🧪 Agent generates: 5 tests for cart, payment, confirmation
|
|
210
|
+
↓
|
|
211
|
+
✅ Executes tests, reports 2 bugs found
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## 📊 Web Interfaces
|
|
215
|
+
|
|
216
|
+
### DevTools Dashboard
|
|
217
|
+
|
|
218
|
+
Real-time monitoring:
|
|
219
|
+
- Current agent status
|
|
220
|
+
- Live action logs
|
|
221
|
+
- Test session history
|
|
222
|
+
- Bugs detected
|
|
223
|
+
- Screenshots captured
|
|
224
|
+
|
|
225
|
+
### Kanban Board
|
|
226
|
+
|
|
227
|
+
Manage QA findings:
|
|
228
|
+
- **Backlog** - Future test ideas
|
|
229
|
+
- **To Do** - Bugs to fix
|
|
230
|
+
- **In Progress** - Being worked on
|
|
231
|
+
- **Done** - Resolved
|
|
232
|
+
|
|
233
|
+
Drag & drop tickets between columns.
|
|
234
|
+
|
|
235
|
+
### Configuration Panel
|
|
236
|
+
|
|
237
|
+
Simple configuration:
|
|
238
|
+
- **SaaS Info** - Name, description, URL
|
|
239
|
+
- **Repository** - Optional GitHub/GitLab URL for code analysis
|
|
240
|
+
- **Directives** - Custom instructions for the agent
|
|
241
|
+
- **LLM Settings** - Provider, API key, model
|
|
242
|
+
- **Git Listener** - Auto-test on merge/deploy
|
|
243
|
+
|
|
244
|
+
## 🔧 Advanced Usage
|
|
245
|
+
|
|
246
|
+
### Full Configuration
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Configure with all options
|
|
250
|
+
curl -X POST http://localhost:3000/api/saas-config \
|
|
251
|
+
-H "Content-Type: application/json" \
|
|
252
|
+
-d '{
|
|
253
|
+
"name": "My E-commerce App",
|
|
254
|
+
"description": "Online store with user accounts, product catalog, shopping cart, and Stripe checkout",
|
|
255
|
+
"url": "https://my-store.com",
|
|
256
|
+
"repoUrl": "https://github.com/myorg/my-store",
|
|
257
|
+
"directives": [
|
|
258
|
+
"Focus on the checkout flow - it has had bugs before",
|
|
259
|
+
"Test with both logged-in and guest users",
|
|
260
|
+
"Check that discount codes work correctly",
|
|
261
|
+
"Verify email notifications are sent"
|
|
262
|
+
],
|
|
263
|
+
"auth": {
|
|
264
|
+
"type": "session",
|
|
265
|
+
"credentials": { "username": "test@example.com", "password": "testpass" }
|
|
266
|
+
}
|
|
267
|
+
}'
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Add Directives On-the-fly
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
# Add a new directive
|
|
274
|
+
curl -X POST http://localhost:3000/api/saas-config/directive \
|
|
275
|
+
-H "Content-Type: application/json" \
|
|
276
|
+
-d '{"directive": "Pay special attention to the new refund feature"}'
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Connect Repository for Code Analysis
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# The Brain will clone and analyze your code
|
|
283
|
+
curl -X POST http://localhost:3000/api/saas-config/repository \
|
|
284
|
+
-H "Content-Type: application/json" \
|
|
285
|
+
-d '{"url": "https://github.com/myorg/my-app"}'
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Generate Specific Tests
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Generate a security test
|
|
292
|
+
curl -X POST http://localhost:3000/api/brain/generate-test \
|
|
293
|
+
-H "Content-Type: application/json" \
|
|
294
|
+
-d '{
|
|
295
|
+
"type": "security",
|
|
296
|
+
"target": "Login form SQL injection",
|
|
297
|
+
"context": "The login form at /login accepts email and password"
|
|
298
|
+
}'
|
|
299
|
+
|
|
300
|
+
# Generate a functional test
|
|
301
|
+
curl -X POST http://localhost:3000/api/brain/generate-test \
|
|
302
|
+
-H "Content-Type: application/json" \
|
|
303
|
+
-d '{
|
|
304
|
+
"type": "functional",
|
|
305
|
+
"target": "User registration flow"
|
|
306
|
+
}'
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Create Custom Agent
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Let the Brain create a specialized agent
|
|
313
|
+
curl -X POST http://localhost:3000/api/brain/create-agent \
|
|
314
|
+
-H "Content-Type: application/json" \
|
|
315
|
+
-d '{"purpose": "Test the multi-step checkout process with various payment methods"}'
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Analyze Before Running
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
# Get analysis and suggestions without running tests
|
|
322
|
+
curl -X POST http://localhost:3000/api/brain/analyze
|
|
323
|
+
|
|
324
|
+
# Response:
|
|
325
|
+
# {
|
|
326
|
+
# "understanding": "E-commerce app with user auth, catalog, cart, checkout",
|
|
327
|
+
# "suggestedTests": ["Test cart persistence", "Test checkout validation", ...],
|
|
328
|
+
# "suggestedAgents": ["Payment Flow Specialist", "Inventory Checker"],
|
|
329
|
+
# "risks": ["Cart race conditions", "Payment double-charge"]
|
|
330
|
+
# }
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Docker Deployment
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
docker-compose up -d
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## 🛠️ Development
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
# Install dependencies
|
|
343
|
+
npm install
|
|
344
|
+
|
|
345
|
+
# Run in development mode
|
|
346
|
+
npm run dev
|
|
347
|
+
|
|
348
|
+
# Build
|
|
349
|
+
npm run build
|
|
350
|
+
|
|
351
|
+
# Run tests
|
|
352
|
+
npm test
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
## 📝 Architecture
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
openqa/
|
|
359
|
+
├── agent/
|
|
360
|
+
│ ├── brain/ # 🧠 Autonomous thinking & test generation
|
|
361
|
+
│ ├── tools/ # Browser, GitHub, Kanban tools
|
|
362
|
+
│ ├── config/ # SaaS configuration
|
|
363
|
+
│ └── webhooks/ # Git listener (GitHub/GitLab)
|
|
364
|
+
├── cli/ # CLI commands
|
|
365
|
+
├── database/ # SQLite database
|
|
366
|
+
└── data/
|
|
367
|
+
├── workspace/ # Cloned repos
|
|
368
|
+
└── generated-tests/ # Tests created by Brain
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## 🔌 API Reference
|
|
372
|
+
|
|
373
|
+
### SaaS Configuration
|
|
374
|
+
- `GET /api/saas-config` - Get current config
|
|
375
|
+
- `POST /api/saas-config` - Full configuration
|
|
376
|
+
- `POST /api/saas-config/quick` - Quick setup (name, description, url)
|
|
377
|
+
- `POST /api/saas-config/directive` - Add directive
|
|
378
|
+
- `POST /api/saas-config/repository` - Set repo URL
|
|
379
|
+
- `POST /api/saas-config/local-path` - Set local path
|
|
380
|
+
|
|
381
|
+
### Brain Control
|
|
382
|
+
- `POST /api/brain/analyze` - Analyze app, get suggestions
|
|
383
|
+
- `POST /api/brain/run` - Start autonomous session
|
|
384
|
+
- `POST /api/brain/generate-test` - Generate specific test
|
|
385
|
+
- `POST /api/brain/create-agent` - Create custom agent
|
|
386
|
+
- `POST /api/brain/run-test/:id` - Execute a test
|
|
387
|
+
|
|
388
|
+
### Data
|
|
389
|
+
- `GET /api/status` - Agent status
|
|
390
|
+
- `GET /api/tests` - Generated tests
|
|
391
|
+
- `GET /api/dynamic-agents` - Created agents
|
|
392
|
+
- `GET /api/sessions` - Test sessions
|
|
393
|
+
- `GET /api/bugs` - Found bugs
|
|
394
|
+
- `GET /api/kanban/tickets` - Kanban board
|
|
395
|
+
|
|
396
|
+
### WebSocket (ws://localhost:3000)
|
|
397
|
+
- `test-generated` - New test created
|
|
398
|
+
- `agent-created` - New agent created
|
|
399
|
+
- `test-started/completed` - Test lifecycle
|
|
400
|
+
- `thinking` - Brain's current thought
|
|
401
|
+
- `analysis-complete` - Analysis finished
|
|
402
|
+
- `session-complete` - Session finished
|
|
403
|
+
- `git-merge` - Merge detected
|
|
404
|
+
- `git-pipeline-success` - Deploy detected
|
|
405
|
+
|
|
406
|
+
## 🤝 Contributing
|
|
407
|
+
|
|
408
|
+
Contributions welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first.
|
|
409
|
+
|
|
410
|
+
## 📄 License
|
|
411
|
+
|
|
412
|
+
MIT
|
|
413
|
+
|
|
414
|
+
## 🙏 Credits
|
|
415
|
+
|
|
416
|
+
Built with:
|
|
417
|
+
- [Orka.js](https://orkajs.dev) - AI framework
|
|
418
|
+
- [Playwright](https://playwright.dev) - Browser automation
|
|
419
|
+
- [Next.js](https://nextjs.org) - Web interface
|
|
420
|
+
- [SQLite](https://sqlite.org) - Database
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
Made with ❤️ by the Orka.js team
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
-- OpenQA Database Schema v2 - Extended for multi-agents and skills
|
|
2
|
+
|
|
3
|
+
CREATE TABLE IF NOT EXISTS config (
|
|
4
|
+
key TEXT PRIMARY KEY,
|
|
5
|
+
value TEXT NOT NULL,
|
|
6
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
CREATE TABLE IF NOT EXISTS test_sessions (
|
|
10
|
+
id TEXT PRIMARY KEY,
|
|
11
|
+
started_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
12
|
+
ended_at DATETIME,
|
|
13
|
+
status TEXT CHECK(status IN ('running', 'completed', 'failed')),
|
|
14
|
+
trigger_type TEXT CHECK(trigger_type IN ('manual', 'scheduled', 'merge', 'pipeline', 'webhook')),
|
|
15
|
+
trigger_data TEXT,
|
|
16
|
+
total_actions INTEGER DEFAULT 0,
|
|
17
|
+
bugs_found INTEGER DEFAULT 0,
|
|
18
|
+
metadata TEXT
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
CREATE TABLE IF NOT EXISTS actions (
|
|
22
|
+
id TEXT PRIMARY KEY,
|
|
23
|
+
session_id TEXT NOT NULL,
|
|
24
|
+
agent_id TEXT,
|
|
25
|
+
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
26
|
+
type TEXT NOT NULL,
|
|
27
|
+
description TEXT,
|
|
28
|
+
input TEXT,
|
|
29
|
+
output TEXT,
|
|
30
|
+
screenshot_path TEXT,
|
|
31
|
+
duration_ms INTEGER,
|
|
32
|
+
FOREIGN KEY (session_id) REFERENCES test_sessions(id)
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
CREATE TABLE IF NOT EXISTS bugs (
|
|
36
|
+
id TEXT PRIMARY KEY,
|
|
37
|
+
session_id TEXT NOT NULL,
|
|
38
|
+
agent_id TEXT,
|
|
39
|
+
title TEXT NOT NULL,
|
|
40
|
+
description TEXT NOT NULL,
|
|
41
|
+
severity TEXT CHECK(severity IN ('low', 'medium', 'high', 'critical')),
|
|
42
|
+
category TEXT CHECK(category IN ('ui', 'security', 'performance', 'accessibility', 'functional', 'other')),
|
|
43
|
+
status TEXT CHECK(status IN ('open', 'in-progress', 'resolved', 'closed', 'false-positive')),
|
|
44
|
+
github_issue_url TEXT,
|
|
45
|
+
gitlab_issue_url TEXT,
|
|
46
|
+
screenshot_path TEXT,
|
|
47
|
+
reproduction_steps TEXT,
|
|
48
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
49
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
50
|
+
FOREIGN KEY (session_id) REFERENCES test_sessions(id)
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
CREATE TABLE IF NOT EXISTS kanban_tickets (
|
|
54
|
+
id TEXT PRIMARY KEY,
|
|
55
|
+
bug_id TEXT,
|
|
56
|
+
title TEXT NOT NULL,
|
|
57
|
+
description TEXT NOT NULL,
|
|
58
|
+
priority TEXT CHECK(priority IN ('low', 'medium', 'high', 'critical')),
|
|
59
|
+
column TEXT CHECK(column IN ('backlog', 'to-do', 'in-progress', 'done')),
|
|
60
|
+
tags TEXT,
|
|
61
|
+
screenshot_url TEXT,
|
|
62
|
+
assigned_to TEXT,
|
|
63
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
64
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
65
|
+
FOREIGN KEY (bug_id) REFERENCES bugs(id)
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
-- New tables for v2
|
|
69
|
+
|
|
70
|
+
CREATE TABLE IF NOT EXISTS specialist_agents (
|
|
71
|
+
id TEXT PRIMARY KEY,
|
|
72
|
+
type TEXT NOT NULL,
|
|
73
|
+
session_id TEXT NOT NULL,
|
|
74
|
+
status TEXT CHECK(status IN ('idle', 'running', 'completed', 'failed', 'stopped')),
|
|
75
|
+
current_task TEXT,
|
|
76
|
+
progress INTEGER DEFAULT 0,
|
|
77
|
+
findings INTEGER DEFAULT 0,
|
|
78
|
+
actions_count INTEGER DEFAULT 0,
|
|
79
|
+
started_at DATETIME,
|
|
80
|
+
completed_at DATETIME,
|
|
81
|
+
error_message TEXT,
|
|
82
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
83
|
+
FOREIGN KEY (session_id) REFERENCES test_sessions(id)
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
CREATE TABLE IF NOT EXISTS skills (
|
|
87
|
+
id TEXT PRIMARY KEY,
|
|
88
|
+
name TEXT NOT NULL,
|
|
89
|
+
description TEXT,
|
|
90
|
+
type TEXT CHECK(type IN ('directive', 'test-scenario', 'custom-check', 'workflow')),
|
|
91
|
+
enabled INTEGER DEFAULT 1,
|
|
92
|
+
priority INTEGER DEFAULT 0,
|
|
93
|
+
prompt TEXT NOT NULL,
|
|
94
|
+
triggers TEXT,
|
|
95
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
96
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
CREATE TABLE IF NOT EXISTS skill_executions (
|
|
100
|
+
id TEXT PRIMARY KEY,
|
|
101
|
+
skill_id TEXT NOT NULL,
|
|
102
|
+
session_id TEXT NOT NULL,
|
|
103
|
+
agent_id TEXT,
|
|
104
|
+
started_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
105
|
+
completed_at DATETIME,
|
|
106
|
+
status TEXT CHECK(status IN ('running', 'completed', 'failed', 'skipped')),
|
|
107
|
+
result TEXT,
|
|
108
|
+
findings_count INTEGER DEFAULT 0,
|
|
109
|
+
FOREIGN KEY (skill_id) REFERENCES skills(id),
|
|
110
|
+
FOREIGN KEY (session_id) REFERENCES test_sessions(id)
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
CREATE TABLE IF NOT EXISTS git_events (
|
|
114
|
+
id TEXT PRIMARY KEY,
|
|
115
|
+
provider TEXT CHECK(provider IN ('github', 'gitlab')),
|
|
116
|
+
event_type TEXT CHECK(event_type IN ('merge', 'push', 'pipeline_success', 'pipeline_failure', 'tag')),
|
|
117
|
+
branch TEXT,
|
|
118
|
+
commit_sha TEXT,
|
|
119
|
+
author TEXT,
|
|
120
|
+
message TEXT,
|
|
121
|
+
pipeline_id TEXT,
|
|
122
|
+
pipeline_status TEXT,
|
|
123
|
+
triggered_session_id TEXT,
|
|
124
|
+
received_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
125
|
+
FOREIGN KEY (triggered_session_id) REFERENCES test_sessions(id)
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
CREATE TABLE IF NOT EXISTS agent_logs (
|
|
129
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
130
|
+
agent_id TEXT NOT NULL,
|
|
131
|
+
session_id TEXT NOT NULL,
|
|
132
|
+
level TEXT CHECK(level IN ('debug', 'info', 'warn', 'error')),
|
|
133
|
+
message TEXT NOT NULL,
|
|
134
|
+
data TEXT,
|
|
135
|
+
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
136
|
+
FOREIGN KEY (session_id) REFERENCES test_sessions(id)
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
-- Indexes
|
|
140
|
+
CREATE INDEX IF NOT EXISTS idx_actions_session ON actions(session_id);
|
|
141
|
+
CREATE INDEX IF NOT EXISTS idx_actions_agent ON actions(agent_id);
|
|
142
|
+
CREATE INDEX IF NOT EXISTS idx_bugs_session ON bugs(session_id);
|
|
143
|
+
CREATE INDEX IF NOT EXISTS idx_bugs_status ON bugs(status);
|
|
144
|
+
CREATE INDEX IF NOT EXISTS idx_bugs_severity ON bugs(severity);
|
|
145
|
+
CREATE INDEX IF NOT EXISTS idx_bugs_category ON bugs(category);
|
|
146
|
+
CREATE INDEX IF NOT EXISTS idx_kanban_column ON kanban_tickets(column);
|
|
147
|
+
CREATE INDEX IF NOT EXISTS idx_specialist_session ON specialist_agents(session_id);
|
|
148
|
+
CREATE INDEX IF NOT EXISTS idx_specialist_status ON specialist_agents(status);
|
|
149
|
+
CREATE INDEX IF NOT EXISTS idx_skill_exec_session ON skill_executions(session_id);
|
|
150
|
+
CREATE INDEX IF NOT EXISTS idx_git_events_branch ON git_events(branch);
|
|
151
|
+
CREATE INDEX IF NOT EXISTS idx_agent_logs_agent ON agent_logs(agent_id);
|
|
152
|
+
CREATE INDEX IF NOT EXISTS idx_agent_logs_session ON agent_logs(session_id);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
-- OpenQA Database Schema
|
|
2
|
+
|
|
3
|
+
CREATE TABLE IF NOT EXISTS config (
|
|
4
|
+
key TEXT PRIMARY KEY,
|
|
5
|
+
value TEXT NOT NULL,
|
|
6
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
CREATE TABLE IF NOT EXISTS test_sessions (
|
|
10
|
+
id TEXT PRIMARY KEY,
|
|
11
|
+
started_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
12
|
+
ended_at DATETIME,
|
|
13
|
+
status TEXT CHECK(status IN ('running', 'completed', 'failed')),
|
|
14
|
+
total_actions INTEGER DEFAULT 0,
|
|
15
|
+
bugs_found INTEGER DEFAULT 0,
|
|
16
|
+
metadata TEXT
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
CREATE TABLE IF NOT EXISTS actions (
|
|
20
|
+
id TEXT PRIMARY KEY,
|
|
21
|
+
session_id TEXT NOT NULL,
|
|
22
|
+
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
23
|
+
type TEXT NOT NULL,
|
|
24
|
+
description TEXT,
|
|
25
|
+
input TEXT,
|
|
26
|
+
output TEXT,
|
|
27
|
+
screenshot_path TEXT,
|
|
28
|
+
FOREIGN KEY (session_id) REFERENCES test_sessions(id)
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
CREATE TABLE IF NOT EXISTS bugs (
|
|
32
|
+
id TEXT PRIMARY KEY,
|
|
33
|
+
session_id TEXT NOT NULL,
|
|
34
|
+
title TEXT NOT NULL,
|
|
35
|
+
description TEXT NOT NULL,
|
|
36
|
+
severity TEXT CHECK(severity IN ('low', 'medium', 'high', 'critical')),
|
|
37
|
+
status TEXT CHECK(status IN ('open', 'in-progress', 'resolved', 'closed')),
|
|
38
|
+
github_issue_url TEXT,
|
|
39
|
+
screenshot_path TEXT,
|
|
40
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
41
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
42
|
+
FOREIGN KEY (session_id) REFERENCES test_sessions(id)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
CREATE TABLE IF NOT EXISTS kanban_tickets (
|
|
46
|
+
id TEXT PRIMARY KEY,
|
|
47
|
+
bug_id TEXT,
|
|
48
|
+
title TEXT NOT NULL,
|
|
49
|
+
description TEXT NOT NULL,
|
|
50
|
+
priority TEXT CHECK(priority IN ('low', 'medium', 'high', 'critical')),
|
|
51
|
+
column TEXT CHECK(column IN ('backlog', 'to-do', 'in-progress', 'done')),
|
|
52
|
+
tags TEXT,
|
|
53
|
+
screenshot_url TEXT,
|
|
54
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
55
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
56
|
+
FOREIGN KEY (bug_id) REFERENCES bugs(id)
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
CREATE INDEX IF NOT EXISTS idx_actions_session ON actions(session_id);
|
|
60
|
+
CREATE INDEX IF NOT EXISTS idx_bugs_session ON bugs(session_id);
|
|
61
|
+
CREATE INDEX IF NOT EXISTS idx_bugs_status ON bugs(status);
|
|
62
|
+
CREATE INDEX IF NOT EXISTS idx_kanban_column ON kanban_tickets(column);
|