mirror of
https://github.com/openzim/zimit.git
synced 2025-09-24 04:30:11 -04:00
Updated test to new stats files
- verify output of crawl, warc2zim and zimit file - using a simpler tag for CI test image as to not confuse it with public image
This commit is contained in:
parent
3ffa34d46e
commit
85fad62b61
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
@ -10,10 +10,10 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: build image
|
||||
run: docker build -t openzim/zimit:dev .
|
||||
run: docker build -t zimit .
|
||||
|
||||
- name: run crawl
|
||||
run: docker run -v $PWD/output:/output openzim/zimit:dev zimit --url http://isago.ml/ --name isago --zim-file isago.zim --adminEmail test@example.com --mobileDevice --statsFilename /output/stats.json --keep
|
||||
run: docker run -v $PWD/output:/output zimit zimit --url http://isago.ml/ --name isago --zim-file isago.zim --adminEmail test@example.com --mobileDevice --statsFilename /output/stats.json --keep
|
||||
|
||||
- name: run integration test suite
|
||||
run: docker run -v $PWD/test/integration.py:/app/integration.py -v $PWD/output:/output openzim/zimit:dev bash -c "pip install pytest; pytest -v ./integration.py"
|
||||
run: docker run -v $PWD/test/integration.py:/app/integration.py -v $PWD/output:/output zimit bash -c "pip install pytest; pytest -v ./integration.py"
|
||||
|
@ -45,9 +45,19 @@ def test_user_agent():
|
||||
|
||||
|
||||
def test_stats_output():
|
||||
with open("/output/stats.json") as fh:
|
||||
with open("/output/crawl.json") as fh:
|
||||
assert json.loads(fh.read()) == {
|
||||
"numCrawled": 5,
|
||||
"workersRunning": 0,
|
||||
"total": 5,
|
||||
}
|
||||
with open("/output/warc2zim.json") as fh:
|
||||
assert json.loads(fh.read()) == {
|
||||
"written": 7,
|
||||
"total": 7,
|
||||
}
|
||||
with open("/output/stats.json") as fh:
|
||||
assert json.loads(fh.read()) == {
|
||||
"done": 7,
|
||||
"total": 7,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user