Skip to content

Write unit tests for static.crates.io function #401

@jdno

Description

@jdno

Context

The crates on crates.io are stored in S3 and served to users through our Content Delivery Networks, most importantly Fastly. On Fastly, we are using their Compute platform to run every request through a custom Rust function.

This function mainly has two responsibilities:

  1. It handles the request, which means applying some rewrite rules and fetching the crate from S3.
  2. It logs the request and sends it to the configured log destinations.

Since the function runs in WebAssembly, testing the function has been historically difficult. But Fastly provides more documentation now that might make it feasible to write unit tests for (some parts of) the function.

Tasks

  • Write (a few) unit tests for the function
  • Document how to run them in local development
  • Run the tests automatically as part of this repository's CI

Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedrustPull requests that update Rust code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions