envoyproxy/envoy

add memory filesystem for making tests faster, more hermetic, and more robust

Open

#11.121 geöffnet am 8. Mai 2020

Auf GitHub ansehen
 (9 Kommentare) (1 Reaktion) (1 zugewiesene Person)C++ (5.373 Forks)batch import
beginnerhelp wanted

Repository-Metriken

Stars
 (27.997 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (378 gemergte PRs in 30 T)

Beschreibung

Currently real files are used for file i/o during tests. An alternative I've used in the past is to have an in-memory representation of a file-system: https://github.com/apache/incubator-pagespeed-mod/blob/master/pagespeed/kernel/base/mem_file_system.h

This has these advantages:

  • completely hermetic, with a clean slate between tests
  • very fast (no I/O), speeding up the running of massive numbers of tests
  • you can inject notifiers etc, so you can for example get a callback or condvar wakeup or similar when a file is written

Envoy already has a filesystem abstraction (yay!) and a way to squirrel that into code that needs to read/write files (Api::Api) just no in-memory impl for it.

I think this would be a good intern project. The example I gave above would not exactly meet Envoy's needs but it could be a reference point.

Contributor Guide