Skip to content

fix: avoid downloading files in tests #1785

Closed
@terriko

Description

@terriko

We're currently having a problem with a file download that's broken, and that file was being used to test the .pkf file extraction.

Investigating it, we've got a couple of files that we're using to test the extractor. I'd like all of them to change to minimal files stored in test/assets if that's possible. That's going to mean building a few valid files that are mostly empty (we could store real files, of course, but that's a lot of space just for a test AND we don't want to be storing vulnerable binaries as these files get older.)

Looking at util.py there may just be 4 such files in total, an rpm , a deb, a zst and a .pkg file:

CURL_7_20_0_RPM = "curl-7.20.0-4.fc13.x86_64.rpm"
CURL_7_20_0_URL = (
    "https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/13/Everything/x86_64/os/Packages/"
    + CURL_7_20_0_RPM
)
TMUX_DEB_NAME = "tmux_1.8-5_amd64.deb"
TMUX_DEB = "https://mirrors.cat.pdx.edu/ubuntu/pool/main/t/tmux/" + TMUX_DEB_NAME
TAR_ZST_NAME = "tar-1.34-1-x86_64.pkg.tar.zst"
TAR_ZST_URL = "https://ftp5.gwdg.de/pub/linux/archlinux/core/os/x86_64/" + TAR_ZST_NAME
GLIB_PKG_NAME = "glib-2.70.4_3,2.pkg"
GLIB_PKG_URL = (
    "https://pkg.freebsd.org/FreeBSD:12:aarch64/quarterly/All/" + GLIB_PKG_NAME
)

If we need something to test the download code, we can download one of these from our own github repo to test that file. But the fewer ways our tests can break due to external factors the better CI will work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions