rust-lang / rust-lang/simpleinfra

Write unit tests for `static.crates.io` function

Open
#401 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted rust
Dominant language
HCL
Stars
178
Forks
107
Avg merge
15h 57m
Merged PRs (30d)
38

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in terragrunt/modules/crates-io/compute-static and read the linked Fastly Rust unit-testing guidance and Viceroy usage. Identify testable parts of the Compute function, then document local test execution and add the tests to this repository's CI. Done means a few unit tests run locally and automatically in CI, with setup documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
ci-cd, documentation, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.