What Tests Catch a Broken Schedule Feed Link?
From the earlier reference collection. Read the current software blog.
Validate a feed link in stages, from successful retrieval through archive integrity to the presence of required schedule files.
Check retrieval before parsing
Request the configured feed URL and assert an acceptable retrieval status for the application’s contract. A redirect may be valid if the client is expected to follow it; a missing resource or an authentication page usually is not. Set a reasonable timeout and report the final URL so a stale redirect or changed endpoint is easier to diagnose.
Inspect the response content type, but treat it as a useful signal rather than the sole proof. Servers sometimes serve a valid archive with a generic binary type, while a page with an archive-like type can still be an error page. Also check that the body is nonempty before attempting to open it.
Verify the archive itself
If the feed is a ZIP archive, open it with the same library or parsing layer used by the application and test archive integrity. A truncated download, HTML error document, or corrupt central directory should produce a clear failure rather than a later, misleading missing-file message.
Keep the network check separate from fixture-based parser tests. A live link check can be useful in a scheduled health job, but making every unit test depend on an external server creates flaky builds. For regular tests, store a small representative archive locally and reserve retrieval checks for an environment where network behavior is expected.
Require the files the parser needs
After opening the archive, assert that required files are present and readable. A schedule feed commonly includes agency, routes, trips, and stop-time data, while calendar information may be represented in more than one way. Follow the feed format and the application’s supported subset rather than assuming every optional file must exist.
Check that expected file names are not hidden inside an unexpected extra directory level. A package can be valid ZIP data but arranged so that a parser looking for root-level files finds nothing. Include a tiny archive fixture for that layout edge case.
Report a useful failure
Structure checks should identify which stage failed: retrieval, content plausibility, archive integrity, or required-file validation. Avoid printing credentials embedded in a URL or dumping the entire response body into logs. A concise diagnostic makes broken links actionable without exposing request details.
Together, these checks distinguish a reachable URL from a usable schedule feed. A working link must deliver an intact archive in a layout the consumer can read, with the files required for the chosen parsing path.