Details
- Reviewers
olasd - Group Reviewers
Reviewers - Commits
- rDSCH099effd6f61f: Start writing tests for the CLI.
Diff Detail
- Repository
- rDSCH Scheduling utilities
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DSCH/job/tox/190/
See console output for more information: https://jenkins.softwareheritage.org/job/DSCH/job/tox/190/console
Build was aborted
Link to build: https://jenkins.softwareheritage.org/job/DSCH/job/tox/192/
See console output for more information: https://jenkins.softwareheritage.org/job/DSCH/job/tox/192/console
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DSCH/job/tox/193/
See console output for more information: https://jenkins.softwareheritage.org/job/DSCH/job/tox/193/console
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DSCH/job/tox/194/
See console output for more information: https://jenkins.softwareheritage.org/job/DSCH/job/tox/194/console
Build is green
See https://jenkins.softwareheritage.org/job/DSCH/job/tox/195/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DSCH/job/tox/196/ for more details.
Thanks for this, looks like a good starting point.
I think I'd wrap the regular expressions' first line with a backslash to look like this:
expected = r'''\ \[INFO\] swh.core.config -- Loading config file .* Found 1 swh-test-ping tasks [...] '''
So that the full text can be more easily copy/pasted.
We can also probably use re.fullmatch to drop the need for the start anchor (I think?)
swh/scheduler/cli.py | ||
---|---|---|
105 | Should probably be updated to say "none set" or something | |
swh/scheduler/tests/test_cli.py | ||
24–35 | Please add a comment to document why we need to jump these hoops. I think I understand it but better be explicit :) |
I tried, it doesn't work.
>>> foo = r'''\ ... foo''' >>> print(foo) \ foo
We can also probably use re.fullmatch to drop the need for the start anchor (I think?)
TIL
Ah, duh.
I guess we can add a leading newline (no escape) and add a .lstrip() to trim it afterwards.
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DSCH/job/tox/206/
See console output for more information: https://jenkins.softwareheritage.org/job/DSCH/job/tox/206/console
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DSCH/job/tox/207/
See console output for more information: https://jenkins.softwareheritage.org/job/DSCH/job/tox/207/console
Build is green
See https://jenkins.softwareheritage.org/job/DSCH/job/tox/208/ for more details.