* chore: add summary to Action * refactor: new summary table * fix: fixup tests and formatting Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: pyodide missing some logging Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: nicer printout, nicer in-place summary Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: use summary for everything Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: support only one output wheel from repair Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Add new Github summary format * Remove a couple of humanize uses * fix: filter ANSI codes in summary Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: add sha256 Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: nicer wheel/wheels depending on how many are present Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Joe Rickerby <joerick@mac.com>
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from cibuildwheel.logger import BuildInfo, Logger
|
|
from cibuildwheel.options import CommandLineArguments, Options
|
|
|
|
OPTIONS_DEFAULTS = Options("linux", CommandLineArguments.defaults(), {}, defaults=True)
|
|
FILE = Path(__file__)
|
|
|
|
|
|
def test_printout_wheels(capsys):
|
|
log = Logger()
|
|
log.fold_mode = "disabled"
|
|
log.colors_enabled = False
|
|
|
|
with log.print_summary(options=OPTIONS_DEFAULTS):
|
|
log.summary = [
|
|
BuildInfo(identifier="id1", filename=None, duration=3),
|
|
BuildInfo(identifier="id2", filename=FILE, duration=2),
|
|
]
|
|
|
|
captured = capsys.readouterr()
|
|
assert captured.err == ""
|
|
|
|
assert "id1" in captured.out
|
|
assert "id2" in captured.out
|
|
assert "wheels produced in" in captured.out
|
|
assert "SHA256=" in captured.out
|
|
|
|
|
|
def test_no_printout_on_error(capsys):
|
|
log = Logger()
|
|
with pytest.raises(RuntimeError), log.print_summary(options=OPTIONS_DEFAULTS):
|
|
raise RuntimeError()
|
|
|
|
captured = capsys.readouterr()
|
|
assert captured.err == ""
|
|
assert captured.out == ""
|