Test data as Artifact

My package’s tests require ~20 MB of data. Currently, this data is regenerated on every test run. I’d like to generate it once (e.g., per release) and fetch it at test time instead.

The Julia Artifacts framework seems like the right fit for this. Is there a guide for this workflow? Specifically: starting from a package with separate test-data-generation code and test code, how do I set things up so that Pkg.test() downloads pre-generated test data via Artifacts and runs the tests against it?

1 Like

Create the Artifacts.toml somehow (if you don’t know, I recommend using ArtifactUtils.jl, you probably want to make the artifact lazy), then in the tests refer to the artifact name with artifact"..." and it’ll be downloaded automatically on demand.

1 Like

In TestImages.jl they (you?) baked in the artifact asset into the release of that package, which is a nice way to link the assets with the code per release. Is there a guide for that?

A guide for what? For upoading a file to a release?

Eh, yeah, basically. Like a step by step guide / blog for how to publish a package that uses artifacts to supply itself with its own test data. I realize as I’m typing this that this does not exist, but I’ll go try this out and see if I can make one.

1 Like

Method 1 of Creating GitHub Releases with Binary Artifacts: A Complete Guide? It’s really two clicks on the web UI, not even GitHub has documentation for this apparently.

1 Like