Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix CONTRIBUTING
  • Loading branch information
Steve Ayers committed May 4, 2023
commit dc064a1dc4a330f61d10082f8188ce4627e61035
29 changes: 2 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,12 @@ The `make` compiles TypeScript to Javascript and runs all test cases
(in `spec/`) in nodejs (using jasmine) and in a headless browser (using karma
and jasmine).

Some test cases use test fixtures from `packages/test-fixtures`.


##### Test fixtures

`packages/test-fixtures/index.ts` exports a `FixtureRegistry`. This registry
provides access to a collection of message type fixtures.

A message type fixture is basically a set of test data for a specific protobuf
message. It has a type name (the qualified protobuf message type name) and
reflection field information. It can also provide message instances.

The only purpose of the fixtures is to isolate test data from test code to make
test cases more readable.
##### Protos

`packages/test-fixtures` also contains a large number of .proto files. These
`packages/proto` contains a large number of .proto files. These
files are used to test code generation and functionality of the generated code.

For each fixture, there should also be a corresponding .proto file. This makes
it possible to compare the field information generated by the plugin to the
field information in the fixture data, asserting that the plugin generates
expected data.

`packages/test-fixtures/all.descriptorset` is a binary protobuf message of type
`FileDescriptorSet` (defined in `google/protobuf/descriptor.proto`). It contains
file descriptors for all .proto files in `test-fixtures`. The descriptor set
is generated using protoc (see `packages/plugin/Makefile` and
`packages/plugin-framework/Makefile`). A `FileDescriptorSet` can be used to
run the plugin during testing without invoking protoc.


##### Testing the plugin

All protobuf plugins work with `CodeGeneratorRequest` and `CodeGeneratorResponse`
Expand Down