assay-kit 0.1.0__tar.gz
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.
- assay_kit-0.1.0/PKG-INFO +176 -0
- assay_kit-0.1.0/README.md +147 -0
- assay_kit-0.1.0/pyproject.toml +59 -0
- assay_kit-0.1.0/setup.cfg +4 -0
- assay_kit-0.1.0/src/assay/__init__.py +6 -0
- assay_kit-0.1.0/src/assay/cli/__init__.py +0 -0
- assay_kit-0.1.0/src/assay/cli/main.py +406 -0
- assay_kit-0.1.0/src/assay/config.py +149 -0
- assay_kit-0.1.0/src/assay/formatter/__init__.py +1 -0
- assay_kit-0.1.0/src/assay/formatter/formatter.py +93 -0
- assay_kit-0.1.0/src/assay/formatter/writer.py +34 -0
- assay_kit-0.1.0/src/assay/grain/__init__.py +0 -0
- assay_kit-0.1.0/src/assay/grain/detect.py +39 -0
- assay_kit-0.1.0/src/assay/ingest/__init__.py +3 -0
- assay_kit-0.1.0/src/assay/ingest/app.py +109 -0
- assay_kit-0.1.0/src/assay/keys/__init__.py +1 -0
- assay_kit-0.1.0/src/assay/keys/store.py +114 -0
- assay_kit-0.1.0/src/assay/runner/__init__.py +0 -0
- assay_kit-0.1.0/src/assay/runner/artifacts.py +73 -0
- assay_kit-0.1.0/src/assay/runner/runner.py +99 -0
- assay_kit-0.1.0/src/assay/schedule/__init__.py +0 -0
- assay_kit-0.1.0/src/assay/schedule/cron.py +29 -0
- assay_kit-0.1.0/src/assay/schedule/daemon.py +125 -0
- assay_kit-0.1.0/src/assay/schedule/loop.py +83 -0
- assay_kit-0.1.0/src/assay/schedule/store.py +98 -0
- assay_kit-0.1.0/src/assay/schemas/__init__.py +15 -0
- assay_kit-0.1.0/src/assay_kit.egg-info/PKG-INFO +176 -0
- assay_kit-0.1.0/src/assay_kit.egg-info/SOURCES.txt +55 -0
- assay_kit-0.1.0/src/assay_kit.egg-info/dependency_links.txt +1 -0
- assay_kit-0.1.0/src/assay_kit.egg-info/entry_points.txt +2 -0
- assay_kit-0.1.0/src/assay_kit.egg-info/requires.txt +12 -0
- assay_kit-0.1.0/src/assay_kit.egg-info/top_level.txt +1 -0
- assay_kit-0.1.0/tests/test_artifacts.py +80 -0
- assay_kit-0.1.0/tests/test_auth.py +115 -0
- assay_kit-0.1.0/tests/test_cli.py +62 -0
- assay_kit-0.1.0/tests/test_config.py +59 -0
- assay_kit-0.1.0/tests/test_config_precedence.py +120 -0
- assay_kit-0.1.0/tests/test_daemon.py +140 -0
- assay_kit-0.1.0/tests/test_e2e_run.py +185 -0
- assay_kit-0.1.0/tests/test_e2e_sdk.py +107 -0
- assay_kit-0.1.0/tests/test_formatter.py +176 -0
- assay_kit-0.1.0/tests/test_grain_integration.py +247 -0
- assay_kit-0.1.0/tests/test_ingest.py +198 -0
- assay_kit-0.1.0/tests/test_keys.py +101 -0
- assay_kit-0.1.0/tests/test_packet_schema.py +83 -0
- assay_kit-0.1.0/tests/test_placeholder.py +6 -0
- assay_kit-0.1.0/tests/test_report_command.py +109 -0
- assay_kit-0.1.0/tests/test_run_command.py +147 -0
- assay_kit-0.1.0/tests/test_runner.py +67 -0
- assay_kit-0.1.0/tests/test_schedule_cli.py +166 -0
- assay_kit-0.1.0/tests/test_schedule_loop.py +148 -0
- assay_kit-0.1.0/tests/test_schedule_store.py +148 -0
- assay_kit-0.1.0/tests/test_scheduler_integration.py +158 -0
- assay_kit-0.1.0/tests/test_schemas.py +172 -0
- assay_kit-0.1.0/tests/test_screenshot_persistence.py +144 -0
- assay_kit-0.1.0/tests/test_sdk_ingest.py +115 -0
- assay_kit-0.1.0/tests/test_writer.py +65 -0
assay_kit-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: assay-kit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Independent verification layer for software projects
|
|
5
|
+
Author: Shaznay Sison
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: testing,verification,playwright,automation
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Topic :: Software Development :: Testing
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: apscheduler>=3.10
|
|
19
|
+
Requires-Dist: bcrypt>=4.1
|
|
20
|
+
Requires-Dist: fastapi>=0.111
|
|
21
|
+
Requires-Dist: jsonschema>=4.23
|
|
22
|
+
Requires-Dist: typer>=0.12
|
|
23
|
+
Requires-Dist: uvicorn>=0.29
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: httpx>=0.27; extra == "dev"
|
|
26
|
+
Requires-Dist: mypy; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest; extra == "dev"
|
|
28
|
+
Requires-Dist: ruff; extra == "dev"
|
|
29
|
+
|
|
30
|
+
# Assay
|
|
31
|
+
|
|
32
|
+
Independent verification layer for software projects. Assay runs Playwright-based browser tests in Docker, captures screenshots and results, formats them as structured task packets, and delivers them to a Grain workflow via the ingest API.
|
|
33
|
+
|
|
34
|
+
## Requirements
|
|
35
|
+
|
|
36
|
+
- Python 3.11+
|
|
37
|
+
- Docker (for `assay run`)
|
|
38
|
+
- Node.js 18+ (for the TypeScript browser SDK)
|
|
39
|
+
|
|
40
|
+
## Install
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install assay-kit
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or from source:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git clone <repo>
|
|
50
|
+
cd assay
|
|
51
|
+
pip install -e .
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
### 1. Configure
|
|
57
|
+
|
|
58
|
+
Create `assay.toml` in your project root (all fields optional — defaults shown):
|
|
59
|
+
|
|
60
|
+
```toml
|
|
61
|
+
[project]
|
|
62
|
+
name = "my-project"
|
|
63
|
+
|
|
64
|
+
[runner]
|
|
65
|
+
docker_image = "assay-playwright:latest"
|
|
66
|
+
timeout_seconds = 300
|
|
67
|
+
|
|
68
|
+
[output]
|
|
69
|
+
directory = "./assay-output"
|
|
70
|
+
|
|
71
|
+
[serve]
|
|
72
|
+
host = "127.0.0.1"
|
|
73
|
+
port = 8000
|
|
74
|
+
|
|
75
|
+
[keys]
|
|
76
|
+
store = "~/.assay/keys.json"
|
|
77
|
+
|
|
78
|
+
[schedule]
|
|
79
|
+
store = "~/.assay/schedules.json"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 2. Run a test
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
assay run --target https://your-app.example.com
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Exit codes: `0` = pass, `3` = fail, `1` = inconclusive or error.
|
|
89
|
+
|
|
90
|
+
### 3. Start the ingest server
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Create an API key first
|
|
94
|
+
assay key create --name ci
|
|
95
|
+
|
|
96
|
+
# Start the server
|
|
97
|
+
assay serve
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 4. Schedule recurring runs
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Add a schedule (standard 5-field cron)
|
|
104
|
+
assay schedule add --cron "0 8 * * *" --suite smoke --target https://your-app.example.com
|
|
105
|
+
|
|
106
|
+
# List schedules
|
|
107
|
+
assay schedule list
|
|
108
|
+
|
|
109
|
+
# Start the scheduler (foreground; Ctrl+C to stop)
|
|
110
|
+
assay schedule run
|
|
111
|
+
|
|
112
|
+
# Remove a schedule
|
|
113
|
+
assay schedule remove <id>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Browser SDK
|
|
117
|
+
|
|
118
|
+
Install the TypeScript SDK in your web app:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npm install assay-sdk
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import { AssaySDK } from "assay-sdk";
|
|
126
|
+
|
|
127
|
+
const sdk = new AssaySDK({
|
|
128
|
+
apiKey: "your-api-key",
|
|
129
|
+
endpoint: "http://localhost:8000",
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// Capture a screenshot + metadata and POST to /ingest
|
|
133
|
+
await sdk.capture({ comment: "Optional human note" });
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Docker Runner
|
|
137
|
+
|
|
138
|
+
The `assay run` command requires a pre-built Docker image containing Playwright.
|
|
139
|
+
|
|
140
|
+
### Build locally
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
cd runner
|
|
144
|
+
docker build -t assay-playwright:latest .
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Use a custom image
|
|
148
|
+
|
|
149
|
+
Set `docker_image` in `assay.toml`:
|
|
150
|
+
|
|
151
|
+
```toml
|
|
152
|
+
[runner]
|
|
153
|
+
docker_image = "myregistry.example.com/assay-playwright:latest"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Or override per-run (future flag — not yet wired in v0.1).
|
|
157
|
+
|
|
158
|
+
## Development
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Install with dev dependencies
|
|
162
|
+
pip install -e ".[dev]"
|
|
163
|
+
|
|
164
|
+
# Run tests
|
|
165
|
+
pytest
|
|
166
|
+
|
|
167
|
+
# Lint
|
|
168
|
+
ruff check src/ tests/
|
|
169
|
+
|
|
170
|
+
# Type check
|
|
171
|
+
mypy src/assay
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
MIT
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Assay
|
|
2
|
+
|
|
3
|
+
Independent verification layer for software projects. Assay runs Playwright-based browser tests in Docker, captures screenshots and results, formats them as structured task packets, and delivers them to a Grain workflow via the ingest API.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Python 3.11+
|
|
8
|
+
- Docker (for `assay run`)
|
|
9
|
+
- Node.js 18+ (for the TypeScript browser SDK)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install assay-kit
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or from source:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
git clone <repo>
|
|
21
|
+
cd assay
|
|
22
|
+
pip install -e .
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
### 1. Configure
|
|
28
|
+
|
|
29
|
+
Create `assay.toml` in your project root (all fields optional — defaults shown):
|
|
30
|
+
|
|
31
|
+
```toml
|
|
32
|
+
[project]
|
|
33
|
+
name = "my-project"
|
|
34
|
+
|
|
35
|
+
[runner]
|
|
36
|
+
docker_image = "assay-playwright:latest"
|
|
37
|
+
timeout_seconds = 300
|
|
38
|
+
|
|
39
|
+
[output]
|
|
40
|
+
directory = "./assay-output"
|
|
41
|
+
|
|
42
|
+
[serve]
|
|
43
|
+
host = "127.0.0.1"
|
|
44
|
+
port = 8000
|
|
45
|
+
|
|
46
|
+
[keys]
|
|
47
|
+
store = "~/.assay/keys.json"
|
|
48
|
+
|
|
49
|
+
[schedule]
|
|
50
|
+
store = "~/.assay/schedules.json"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Run a test
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
assay run --target https://your-app.example.com
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Exit codes: `0` = pass, `3` = fail, `1` = inconclusive or error.
|
|
60
|
+
|
|
61
|
+
### 3. Start the ingest server
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Create an API key first
|
|
65
|
+
assay key create --name ci
|
|
66
|
+
|
|
67
|
+
# Start the server
|
|
68
|
+
assay serve
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 4. Schedule recurring runs
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Add a schedule (standard 5-field cron)
|
|
75
|
+
assay schedule add --cron "0 8 * * *" --suite smoke --target https://your-app.example.com
|
|
76
|
+
|
|
77
|
+
# List schedules
|
|
78
|
+
assay schedule list
|
|
79
|
+
|
|
80
|
+
# Start the scheduler (foreground; Ctrl+C to stop)
|
|
81
|
+
assay schedule run
|
|
82
|
+
|
|
83
|
+
# Remove a schedule
|
|
84
|
+
assay schedule remove <id>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Browser SDK
|
|
88
|
+
|
|
89
|
+
Install the TypeScript SDK in your web app:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm install assay-sdk
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { AssaySDK } from "assay-sdk";
|
|
97
|
+
|
|
98
|
+
const sdk = new AssaySDK({
|
|
99
|
+
apiKey: "your-api-key",
|
|
100
|
+
endpoint: "http://localhost:8000",
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// Capture a screenshot + metadata and POST to /ingest
|
|
104
|
+
await sdk.capture({ comment: "Optional human note" });
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Docker Runner
|
|
108
|
+
|
|
109
|
+
The `assay run` command requires a pre-built Docker image containing Playwright.
|
|
110
|
+
|
|
111
|
+
### Build locally
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
cd runner
|
|
115
|
+
docker build -t assay-playwright:latest .
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Use a custom image
|
|
119
|
+
|
|
120
|
+
Set `docker_image` in `assay.toml`:
|
|
121
|
+
|
|
122
|
+
```toml
|
|
123
|
+
[runner]
|
|
124
|
+
docker_image = "myregistry.example.com/assay-playwright:latest"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Or override per-run (future flag — not yet wired in v0.1).
|
|
128
|
+
|
|
129
|
+
## Development
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Install with dev dependencies
|
|
133
|
+
pip install -e ".[dev]"
|
|
134
|
+
|
|
135
|
+
# Run tests
|
|
136
|
+
pytest
|
|
137
|
+
|
|
138
|
+
# Lint
|
|
139
|
+
ruff check src/ tests/
|
|
140
|
+
|
|
141
|
+
# Type check
|
|
142
|
+
mypy src/assay
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
MIT
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "assay-kit"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Independent verification layer for software projects"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = { text = "MIT" }
|
|
7
|
+
authors = [{ name = "Shaznay Sison" }]
|
|
8
|
+
keywords = ["testing", "verification", "playwright", "automation"]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Development Status :: 3 - Alpha",
|
|
11
|
+
"Intended Audience :: Developers",
|
|
12
|
+
"License :: OSI Approved :: MIT License",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3.11",
|
|
15
|
+
"Programming Language :: Python :: 3.12",
|
|
16
|
+
"Programming Language :: Python :: 3.13",
|
|
17
|
+
"Topic :: Software Development :: Testing",
|
|
18
|
+
]
|
|
19
|
+
requires-python = ">=3.11"
|
|
20
|
+
dependencies = [
|
|
21
|
+
"apscheduler>=3.10",
|
|
22
|
+
"bcrypt>=4.1",
|
|
23
|
+
"fastapi>=0.111",
|
|
24
|
+
"jsonschema>=4.23",
|
|
25
|
+
"typer>=0.12",
|
|
26
|
+
"uvicorn>=0.29",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.scripts]
|
|
30
|
+
assay = "assay.cli.main:app"
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = [
|
|
34
|
+
"httpx>=0.27",
|
|
35
|
+
"mypy",
|
|
36
|
+
"pytest",
|
|
37
|
+
"ruff",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[build-system]
|
|
41
|
+
requires = ["setuptools>=68"]
|
|
42
|
+
build-backend = "setuptools.build_meta"
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.packages.find]
|
|
45
|
+
where = ["src"]
|
|
46
|
+
|
|
47
|
+
[tool.ruff]
|
|
48
|
+
src = ["src"]
|
|
49
|
+
line-length = 120
|
|
50
|
+
|
|
51
|
+
[tool.ruff.lint]
|
|
52
|
+
select = ["E", "F", "I"]
|
|
53
|
+
|
|
54
|
+
[tool.mypy]
|
|
55
|
+
strict = true
|
|
56
|
+
packages = ["assay"]
|
|
57
|
+
|
|
58
|
+
[tool.pytest.ini_options]
|
|
59
|
+
testpaths = ["tests"]
|
|
File without changes
|