Skip to content

Commit 21d2957

Browse files
committed
Vacuum program test.
1 parent 1717044 commit 21d2957

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

test/int/test_archive.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,23 @@ def test_clean_up_jobs(tmp_path):
219219
assert job_ids == {job_id2, archive_job_id}
220220

221221

222+
def test_vacuum():
223+
with closing(ApsisService()) as inst:
224+
inst.create_db()
225+
inst.write_cfg()
226+
inst.start_serve()
227+
inst.wait_for_serve()
228+
229+
client = inst.client
230+
231+
res = client.schedule_adhoc("now", {
232+
"program": {
233+
"type": "apsis.program.internal.vacuum.VacuumProgram",
234+
},
235+
})
236+
res = inst.wait_run(res["run_id"])
237+
assert res["state"] == "success"
238+
meta = res["meta"]["program"]
239+
assert meta["time"] > 0
240+
241+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
params: [label, age]
2+
3+
program:
4+
type: apsis.program.internal.archive.ArchiveProgram
5+
age: "{{ age }}"
6+
path: "/home/alex/dev/apsis/test/manual/procstar/archive/{{ label }}.db"
7+
count: 1000000
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
program:
2+
type: apsis.program.internal.vacuum.VacuumProgram
3+

0 commit comments

Comments
 (0)