fix(ci): support ipset sockets and deployed image smoke checks
quality / changes (push) Successful in 6s
quality / commitlint (push) Skipped
quality / openapi (push) Successful in 28s
quality / web (push) Successful in 57s
quality / api (push) Successful in 1m35s
quality / linux-agent-smoke (push) Successful in 24s
quality / docker-check (push) Failing after 3m20s
CD / quality (push) Failing after 6m56s
CD / publish (push) Skipped
quality / changes (push) Successful in 6s
quality / commitlint (push) Skipped
quality / openapi (push) Successful in 28s
quality / web (push) Successful in 57s
quality / api (push) Successful in 1m35s
quality / linux-agent-smoke (push) Successful in 24s
quality / docker-check (push) Failing after 3m20s
CD / quality (push) Failing after 6m56s
CD / publish (push) Skipped
This commit is contained in:
1 parent
4db34f94f2
commit
57b7652d4d
11 files changed
+206
-15
No files matched your search
@@ -13,6 +13,8 @@ id="evofw-smoke-$(date +%s)-$$"
|
||||
volume="$id-data"
|
||||
restore_volume="$id-restore"
|
||||
container="$id"
|
||||
marker_id=''
|
||||
marker_name="$id-persistence"
|
||||
tmp="$(mktemp -d)"
|
||||
cleanup() {
|
||||
result=$?
|
||||
@@ -38,7 +40,32 @@ start() {
|
||||
done
|
||||
}
|
||||
marker() {
|
||||
docker exec "$container" node -e "const D=require('node:module').createRequire('/app/node_modules/@evofw/db/package.json')('better-sqlite3'); const db=new D('/data/app.db'); if(process.argv[1]==='write') db.prepare('INSERT OR REPLACE INTO settings(key,value) VALUES (?,?)').run('ci-smoke','survives'); else if(db.prepare('SELECT value FROM settings WHERE key=?').get('ci-smoke')?.value!=='survives')process.exitCode=1; db.close()" "$1"
|
||||
value="$(docker exec -i "$container" node --input-type=module - "$1" "$marker_id" "$marker_name" <<'MARKER'
|
||||
import assert from 'node:assert/strict'
|
||||
const [mode, existingId, name] = process.argv.slice(2)
|
||||
assert.ok(mode === 'write' || mode === 'read')
|
||||
const call = async (path, options = {}) => {
|
||||
const response = await fetch(`http://127.0.0.1:8080/api/v1${path}`, { ...options, signal: AbortSignal.timeout(10000) })
|
||||
assert.ok(response.ok, `Persistence marker HTTP ${response.status}`)
|
||||
return response.json()
|
||||
}
|
||||
let id = existingId
|
||||
if (mode === 'write' && !id) {
|
||||
const created = await call('/lists', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ name, type: 'static', entries: ['192.0.2.123/32'] }) })
|
||||
assert.ok(typeof created.id === 'string' && created.id.length > 0, 'Marker creation did not return an ID')
|
||||
id = created.id
|
||||
}
|
||||
assert.ok(id, 'Persistence marker ID is missing')
|
||||
const stored = await call(`/lists/${encodeURIComponent(id)}`)
|
||||
assert.equal(stored.id, id)
|
||||
assert.equal(stored.name, name)
|
||||
assert.equal(stored.type, 'static')
|
||||
assert.deepEqual(stored.entries, ['192.0.2.123/32'], 'Marker entries did not survive')
|
||||
assert.equal(stored.entry_count, 1)
|
||||
process.stdout.write(id)
|
||||
MARKER
|
||||
)"
|
||||
if [ "$1" = write ]; then marker_id="$value"; fi
|
||||
}
|
||||
stop() {
|
||||
docker stop -t 30 "$container" >/dev/null
|
||||
|
||||
Reference in new issue
Block a user