mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-26 23:52:05 +00:00
ci: make the live job honest about what it ran and skipped
Three holes in the live job. (1) It ran -p x-media only, on the comment that everything network-gated lives there — false: xmedia-bot carries two #[ignore]d live tests (repair refetch, text-only link) that CI never executed; both crates run now, still behind the 'live' name filter, and the bot crate's tests need no token (their sends go through MockSender). (2) BILIBILI_COOKIE was never passed, so the bilibili live tests always hit the risk-control early return. (3) That early return — like the pixiv download test's token gate — printed an indistinguishable 'skipping:' line that --show-output never showed, so with continue-on-error a fully-skipped weekly run read exactly like full coverage; skips now print a 'SKIP ' prefix, the steps tee with --show-output, and a summary step lists every skip in the run summary plus a workflow warning. The redundant 'Run token-gated tests' step (the whole non-ignored suite, a rerun of the test job) goes away with the comment that justified it.
This commit is contained in:
@@ -1007,13 +1007,14 @@ mod tests {
|
||||
/// Fetches a live dynamic, skipping the assertion when bilibili
|
||||
/// risk-controls this IP (the site blocks datacenter/over-used addresses
|
||||
/// with `-352` regardless of cookies — a real failure would surface as a
|
||||
/// parse error or a not-found instead). Mirrors the token-gated pixiv
|
||||
/// tests' "skipping: …" convention.
|
||||
/// parse error or a not-found instead). Mirrors the pixiv download
|
||||
/// test's `SKIP …` convention — CI's live job greps that prefix to list
|
||||
/// the skips in the run summary instead of showing a silently green run.
|
||||
async fn live_fetch(url: &str) -> Option<Fetched> {
|
||||
match fetch_from_url(url).await {
|
||||
Ok(fetched) => Some(fetched),
|
||||
Err(e) if e.to_string().contains("risk control") => {
|
||||
eprintln!("skipping: {e}");
|
||||
eprintln!("SKIP (bilibili risk control): {e}");
|
||||
None
|
||||
}
|
||||
Err(e) => panic!("{e}"),
|
||||
|
||||
Reference in New Issue
Block a user