ci: fetch apt indexes over HTTPS so the install step stops hanging #31
@@ -11,6 +11,21 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Install system libraries and Node.js (required by actions/checkout)
|
- name: Install system libraries and Node.js (required by actions/checkout)
|
||||||
run: |
|
run: |
|
||||||
|
# Switch apt to HTTPS mirrors. Measured from this runner on
|
||||||
|
# 2026-08-04: the SAME index file takes 20.1s over http:// and 3.1s
|
||||||
|
# over https://. apt fetches many indexes serially, so http:// does
|
||||||
|
# not read as "slow" -- it reads as a hang (zero bytes in
|
||||||
|
# /var/cache/apt/archives after 3+ minutes, apt's http workers parked
|
||||||
|
# in S state). rocker/r-ver:4.4 already ships ca-certificates and
|
||||||
|
# apt 2.8.3 has the https method built in, so nothing needs to be
|
||||||
|
# installed over http first to bootstrap this.
|
||||||
|
# `|| true` because the step runs under `sh -e`: on an image whose
|
||||||
|
# sources live in the other location, the missing-file sed must not
|
||||||
|
# kill the job.
|
||||||
|
sed -i -E 's#http://(archive|security)\.ubuntu\.com#https://\1.ubuntu.com#g' \
|
||||||
|
/etc/apt/sources.list.d/ubuntu.sources 2>/dev/null || true
|
||||||
|
sed -i -E 's#http://(archive|security)\.ubuntu\.com#https://\1.ubuntu.com#g' \
|
||||||
|
/etc/apt/sources.list 2>/dev/null || true
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
nodejs git \
|
nodejs git \
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ test_that("cog_manifest returns the active session's parsed manifest", {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test_that(".validate_schema accepts schema_version 4, 5 and 6, rejects others", {
|
test_that(".validate_schema accepts schema_version 4 through 7, rejects others", {
|
||||||
expect_silent(uscogdata:::.validate_schema(list(schema_version = 4L)))
|
expect_silent(uscogdata:::.validate_schema(list(schema_version = 4L)))
|
||||||
expect_silent(uscogdata:::.validate_schema(list(schema_version = 5L)))
|
expect_silent(uscogdata:::.validate_schema(list(schema_version = 5L)))
|
||||||
# v6 = FIPS geography harmonization (2026-07-22): _code -> _asof rename +
|
# v6 = FIPS geography harmonization (2026-07-22): _code -> _asof rename +
|
||||||
@@ -119,12 +119,22 @@ test_that(".validate_schema accepts schema_version 4, 5 and 6, rejects others",
|
|||||||
# renamed columns and its geography comes from the xwalk, so v6 is accepted
|
# renamed columns and its geography comes from the xwalk, so v6 is accepted
|
||||||
# without behavioural change -- see .validate_schema()'s note.
|
# without behavioural change -- see .validate_schema()'s note.
|
||||||
expect_silent(uscogdata:::.validate_schema(list(schema_version = 6L)))
|
expect_silent(uscogdata:::.validate_schema(list(schema_version = 6L)))
|
||||||
|
# v7 = `data_year` APPENDED as column 29 (cog_pipeline #80, 2026-08-03), the
|
||||||
|
# most recent fiscal year contributing to a collapsed key. Appended, never
|
||||||
|
# inserted: canonical_govid stays at position 26, so nothing this package
|
||||||
|
# reads shifts. Verified against the real v7 corpus before widening the
|
||||||
|
# allow-list -- cog_spending()/cog_balances() return correctly for FY2024 AND
|
||||||
|
# for FY2012, so the new column is inert here.
|
||||||
|
expect_silent(uscogdata:::.validate_schema(list(schema_version = 7L)))
|
||||||
expect_error(
|
expect_error(
|
||||||
uscogdata:::.validate_schema(list(schema_version = 3L)),
|
uscogdata:::.validate_schema(list(schema_version = 3L)),
|
||||||
"schema_version"
|
"schema_version"
|
||||||
)
|
)
|
||||||
|
# The upper bound still has to be ENFORCED, not just moved. Without this the
|
||||||
|
# test would no longer prove that an unknown future schema is refused, and a
|
||||||
|
# v8 corpus with a genuinely breaking change would sail through.
|
||||||
expect_error(
|
expect_error(
|
||||||
uscogdata:::.validate_schema(list(schema_version = 7L)),
|
uscogdata:::.validate_schema(list(schema_version = 8L)),
|
||||||
"schema_version"
|
"schema_version"
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user