Skip to content

Commit d888e9e

Browse files
authored
revive CI. mostlly disable IA tests. (#34)
1 parent 719dc68 commit d888e9e

File tree

3 files changed

+91
-9
lines changed

3 files changed

+91
-9
lines changed

.github/workflows/ci.yaml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
# runtime is erratic and up to an hour
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
unit-tests:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
#max-parallel: 1
18+
matrix:
19+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
20+
os: [ubuntu-latest]
21+
EXTRA: [false] # used to force includes to get included
22+
include:
23+
- python-version: '3.12'
24+
os: ubuntu-latest
25+
EXTRA: true
26+
env:
27+
LOGLEVEL=DEBUG
28+
- python-version: '3.11'
29+
os: macos-latest
30+
EXTRA: true
31+
- python-version: '3.12'
32+
os: macos-latest
33+
EXTRA: true
34+
- python-version: '3.7'
35+
os: windows-latest
36+
EXTRA: true
37+
- python-version: '3.12'
38+
os: windows-latest
39+
EXTRA: true
40+
- python-version: '3.7'
41+
os: ubuntu-20.04 # oldest version on github actions
42+
EXTRA: true
43+
44+
steps:
45+
- name: checkout
46+
uses: actions/checkout@v4
47+
48+
- name: Set up Python ${{ matrix.python-version }}
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
53+
- name: Install setuptools on python 3.12+
54+
if: ${{ matrix.python-version >= '3.12' }}
55+
run: |
56+
pip install setuptools
57+
58+
- name: Install cdx_toolkit
59+
run: pip install .[test]
60+
61+
- name: Run tests
62+
run: |
63+
make test_coverage
64+
65+
- name: Upload coverage to Codecov
66+
uses: codecov/codecov-action@v4
67+
with:
68+
token: ${{ secrets.CODECOV_TOKEN }}

setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# remember: keep requires synchronized with requirements.txt
1313
requires = ['requests', 'warcio']
1414

15-
test_requirements = ['pytest', 'pytest-cov', 'coveralls']
15+
test_requirements = ['pytest', 'pytest-cov']
1616

1717
package_requirements = ['twine', 'setuptools', 'setuptools-scm']
1818

@@ -37,7 +37,7 @@
3737
author_email='[email protected]',
3838
url='https://github.com/cocrawler/cdx_toolkit',
3939
packages=packages,
40-
python_requires=">=3.6",
40+
python_requires=">=3.7",
4141
extras_require=extras_require,
4242
setup_requires=['setuptools-scm'],
4343
install_requires=requires,
@@ -59,7 +59,7 @@
5959
'License :: OSI Approved :: Apache Software License',
6060
'Programming Language :: Python',
6161
#'Programming Language :: Python :: 3.5', # setuptools-scm problem
62-
'Programming Language :: Python :: 3.6',
62+
#'Programming Language :: Python :: 3.6', # not offered in github actions
6363
'Programming Language :: Python :: 3.7',
6464
'Programming Language :: Python :: 3.8',
6565
'Programming Language :: Python :: 3.9',

tests/test_cli.py

+20-6
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def test_multi_cc2(capsys, caplog):
103103
multi_helper(t, capsys, caplog)
104104

105105

106+
@pytest.mark.skip(reason='needs some ratelimit love XXX')
106107
def test_multi_ia(capsys, caplog):
107108
tests = [
108109
[{'service': '--ia', 'mods': '--limit 10', 'cmd': 'iter', 'rest': 'commoncrawl.org/*'},
@@ -121,7 +122,7 @@ def test_multi_ia(capsys, caplog):
121122
multi_helper(t, capsys, caplog)
122123

123124

124-
def test_multi_rest(capsys, caplog):
125+
def test_multi_misc_notia(capsys, caplog):
125126
tests = [
126127
[{'service': '--source https://web.archive.org/cdx/search/cdx', 'mods': '--limit 10', 'cmd': 'iter', 'rest': 'commoncrawl.org/*'},
127128
{'count': 10, 'linefgrep': 'commoncrawl.org'}],
@@ -132,17 +133,26 @@ def test_multi_rest(capsys, caplog):
132133

133134
[{'service': '--cc', 'mods': '--limit 10', 'cmd': 'size', 'rest': 'commoncrawl.org/*'},
134135
{'count': 1, 'is_int': True}],
135-
[{'service': '--ia', 'mods': '--limit 10', 'cmd': 'size', 'rest': 'commoncrawl.org/*'},
136-
{'count': 1, 'is_int': True}],
137136
[{'service': '--cc', 'mods': '--limit 10', 'cmd': 'size', 'rest': '--details commoncrawl.org/*'},
138137
{'count': 2}],
138+
139+
[{'service': '', 'mods': '--limit 10', 'cmd': 'iter', 'rest': 'commoncrawl.org/*'},
140+
{'exception': ValueError}],
141+
]
142+
143+
for t in tests:
144+
multi_helper(t, capsys, caplog)
145+
146+
147+
@pytest.mark.skip(reason='needs some ratelimit love XXX')
148+
def test_multi_misc_ia(capsys, caplog):
149+
tests = [
150+
[{'service': '--ia', 'mods': '--limit 10', 'cmd': 'size', 'rest': 'commoncrawl.org/*'},
151+
{'count': 1, 'is_int': True}],
139152
[{'service': '--ia', 'mods': '--limit 10', 'cmd': 'size', 'rest': '--details commoncrawl.org/*'},
140153
{'count': 2}],
141154
[{'service': '--ia', 'mods': '--from 20180101 --to 20180110 --limit 10', 'cmd': 'size', 'rest': '--details commoncrawl.org'},
142155
{'count': 2}],
143-
144-
[{'service': '', 'mods': '--limit 10', 'cmd': 'iter', 'rest': 'commoncrawl.org/*'},
145-
{'exception': ValueError}],
146156
]
147157

148158
for t in tests:
@@ -163,6 +173,9 @@ def test_warc(tmpdir, caplog):
163173

164174
with tmpdir.as_cwd():
165175
for p in prefixes:
176+
if '--ia' in p or 'archive.org' in p:
177+
# XXX skip
178+
continue
166179
cmdline = p + base
167180
print(cmdline, file=sys.stderr)
168181
args = cmdline.split()
@@ -182,6 +195,7 @@ def one_ia_corner(tmpdir, cmdline):
182195
main(args=cmdline.split())
183196

184197

198+
@pytest.mark.skip(reason='needs some ratelimit love XXX')
185199
def test_warc_ia_corners(tmpdir, caplog):
186200
'''
187201
To test these more properly, need to add a --exact-warcname and then postprocess.

0 commit comments

Comments
 (0)