Skip to content

Commit

Permalink
Fix CONTRIBUTING (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
smaye81 authored May 4, 2023
1 parent ded8791 commit 0fe66b2
Showing 1 changed file with 2 additions and 27 deletions.
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

0 comments on commit 0fe66b2

Please sign in to comment.