Skip to content

Revamp fixtures#244

Merged
jbourassa merged 12 commits intomainfrom
jb/fixtures-cleanup
Feb 22, 2024
Merged

Revamp fixtures#244
jbourassa merged 12 commits intomainfrom
jb/fixtures-cleanup

Conversation

@jbourassa
Copy link
Contributor

@jbourassa jbourassa commented Feb 20, 2024

The "benchmarks" folders hosted test fixtures and "benchmarks" that were meant to give users an idea of how close they are to limits. Those benchmarks are now irrelevant:

  1. Devs no longer need to figure out how much 5ms of our production server amounts to on their machine. Instruction count replaced that.
  2. For any other limits, you don't need a benchmark to compare, you just have to look at the value reported by function runner (linear memory, stack memory, binary size).

The only reason to carry these examples around now are test fixtures. This PR makes this clear, and cleans up the fixtures:

  • rename benchmarks to fixtures
  • add build instructions
  • trims down the set of test programs and inputs
    • also remove the need to manually edit compiled artifacts 🙈

The diff is large, but the PR should be easy to review by looking at the individual commits.

We don't need to go through the memory names so let's avoid it.
No need a complex JSON if the function never reads it
Many tests used the "runtime_function" for which we no longer had the source
checked in. Diggin, I found that it tried to approximate 5ms of runtime in
production. It also uses an old input style. Using `exit_code.wasm` lets us
test the same things with less baggage.

I also merged the `exit(0)` and `exit(1)` Wasms into 1 Wasm that
reads its exit code from stdin.

As a result, we can drop 2 (large-ish) Wasm fixtures and 2 JSON files
@jbourassa jbourassa marked this pull request as ready for review February 20, 2024 00:34
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I extract this from the Wasm file we had by reading the custom data section.

@jbourassa jbourassa merged commit 1b469e6 into main Feb 22, 2024
@jbourassa jbourassa deleted the jb/fixtures-cleanup branch February 22, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants