Skip to content

Commit

Permalink
chore: Remove the bin testing approach (stephenh#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenh authored Jun 5, 2024
1 parent dd772ef commit e2c149e
Show file tree
Hide file tree
Showing 193 changed files with 275 additions and 333 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Prepare Integration
run: ./integration/pbjs.sh
- name: Codegen
run: yarn bin2ts
run: yarn proto2ts
# This will fail if any git-tracked file has changed
- name: Diff Output
run: git status && git diff --exit-code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Prepare Integration
run: ./integration/pbjs.sh
- name: Codegen
run: yarn bin2ts
run: yarn proto2ts
# This will fail if any git-tracked file has changed
- name: Diff Output
run: git status && git diff --exit-code
Expand Down
7 changes: 3 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,7 @@ The commands below assume you have **Docker** installed. If you are using OS X,
- Run `yarn build:test` to generate the test files.
> _This runs the following commands:_
>
> - `proto2bin` — Converts integration test `.proto` files to `.bin`.
> - `bin2ts` — Runs `ts-proto` on the `.bin` files to generate `.ts` files.
> - `proto2ts` — Runs `ts-proto` on the `integration/**/*.proto` files to generate `.ts` files.
> - `proto2pbjs` — Generates a reference implementation using `pbjs` for testing compatibility.
- Run `yarn test`

Expand All @@ -704,8 +703,8 @@ The commands below assume you have **Docker** installed. If you are using OS X,
- Add/update a `integration/your-new-test/some-test.ts` unit test, even if it's as trivial as just making sure the generated code compiles
- Modify the `ts-proto` code generation logic:
- Most important logic is found in [src/main.ts](src/main.ts).
- After any changes to `src/*.ts` files, run `yarn bin2ts` to re-codegen all integration tests
- Or `yarn bin2ts your-new-test` to re-codegen a specific test
- After any changes to `src/*.ts` files, run `yarn proto2ts` to re-codegen all integration tests
- Or `yarn proto2ts your-new-test` to re-codegen a specific test
- Again leaving `yarn watch` running should "just do the right thing"
- Run `yarn test` to verify your changes pass all existing tests
- Commit and submit a PR
Expand Down
Binary file removed integration/angular/simple-message.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/async-iterable-services/simple.bin
Binary file not shown.
Binary file removed integration/avoid-import-conflicts-folder-name/ui.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed integration/avoid-import-conflicts/simple.bin
Binary file not shown.
Binary file removed integration/avoid-import-conflicts/simple2.bin
Binary file not shown.
Binary file removed integration/barrel-imports/bar.bin
Binary file not shown.
Binary file removed integration/barrel-imports/foo.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/batching-with-context/batching.bin
Binary file not shown.
Binary file removed integration/batching/batching.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/before-after-request/simple.bin
Binary file not shown.
Binary file removed integration/before-after-request/simple2.bin
Binary file not shown.
Binary file removed integration/bytes-as-base64-browser/message.bin
Binary file not shown.
Binary file removed integration/bytes-as-base64-node/message.bin
Binary file not shown.
Binary file removed integration/bytes-as-base64/message.bin
Binary file not shown.
Binary file removed integration/bytes-node/point.bin
Binary file not shown.
58 changes: 0 additions & 58 deletions integration/codegen.sh

This file was deleted.

93 changes: 0 additions & 93 deletions integration/codegen.ts

This file was deleted.

Binary file removed integration/const-enum/const-enum.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion integration/dump-response.bin

This file was deleted.

Binary file removed integration/emit-default-values-json/test.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/enums-as-literals/enums-as-literals.bin
Binary file not shown.
Binary file removed integration/enums-with-unrecognized-name-value/test.bin
Binary file not shown.
82 changes: 82 additions & 0 deletions integration/extension-import/base.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions integration/extension-import/extension.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions integration/extension-import/index.foo.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions integration/extension-import/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions integration/extension-import/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "es2018",
"lib": ["es2018"],
"module": "commonjs",
"strict": true,
"outDir": "build",
"skipLibCheck": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},
"include": ["./"]
}
Binary file removed integration/extensions/test.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/fieldmask/fieldmask.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed integration/file-suffix/child.bin
Binary file not shown.
Binary file removed integration/file-suffix/parent.bin
Binary file not shown.
Binary file removed integration/from-partial-no-initialize/test.bin
Binary file not shown.
Binary file removed integration/fromJson-enums/from-json.bin
Binary file not shown.
Binary file removed integration/generic-metadata/hero.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/generic-service-definitions/simple.bin
Binary file not shown.
Binary file removed integration/global-this/global-this.bin
Binary file not shown.
Binary file removed integration/groups/test.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed integration/grpc-js/google/protobuf/wrappers.bin
Binary file not shown.
Binary file removed integration/grpc-js/simple.bin
Binary file not shown.
Binary file removed integration/grpc-web-abort-signal/example.bin
Binary file not shown.
Binary file removed integration/grpc-web-go-server/example.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/grpc-web-no-streaming/example.bin
Binary file not shown.
Binary file removed integration/grpc-web/example.bin
Binary file not shown.
Binary file removed integration/handle-error-in-default-service/simple.bin
Binary file not shown.
Binary file removed integration/handle-error-with-after-response/simple.bin
Binary file not shown.
Binary file removed integration/import-mapping/mapping.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/import-suffix/child.bin
Binary file not shown.
Binary file removed integration/import-suffix/parent.bin
Binary file not shown.
Binary file removed integration/lower-case-svc-methods/math.bin
Binary file not shown.
Binary file removed integration/map-bigint-optional/test.bin
Binary file not shown.
Binary file removed integration/map-long-optional/test.bin
Binary file not shown.
Binary file removed integration/map-longstring-optional/test.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/meta-typings/google/type/date.bin
Binary file not shown.
Binary file removed integration/meta-typings/import_dir/thing.bin
Binary file not shown.
Binary file removed integration/meta-typings/simple.bin
Binary file not shown.
Binary file removed integration/nestjs-metadata-grpc-js/hero.bin
Binary file not shown.
Binary file removed integration/nestjs-metadata-observables/hero.bin
Binary file not shown.
Binary file removed integration/nestjs-metadata-restparameters/hero.bin
Binary file not shown.
Binary file removed integration/nestjs-metadata/hero.bin
Binary file not shown.
Binary file removed integration/nestjs-restparameters/hero.bin
Binary file not shown.
Binary file removed integration/nestjs-simple-observables/hero.bin
Binary file not shown.
Binary file removed integration/nestjs-simple-restparameters/hero.bin
Binary file not shown.
Binary file removed integration/nestjs-simple-usedate/hero.bin
Binary file not shown.
Binary file removed integration/nestjs-simple/hero.bin
Binary file not shown.
Binary file removed integration/nice-grpc/google/protobuf/wrappers.bin
Binary file not shown.
Binary file removed integration/nice-grpc/simple.bin
Binary file not shown.
Binary file removed integration/no-comments/simple.bin
Binary file not shown.
Binary file removed integration/no-proto-package/no-proto-package.bin
Binary file not shown.
Binary file removed integration/omit-optionals/simple.bin
Binary file not shown.
Binary file removed integration/oneof-properties/oneof.bin
Binary file not shown.
Binary file removed integration/oneof-unions-snake/simple.bin
Binary file not shown.
Binary file removed integration/oneof-unions/oneof.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/only-types/reservation.bin
Binary file not shown.
Binary file removed integration/optional-long/test.bin
Binary file not shown.
Binary file removed integration/optional-type-definitions/simple.bin
Binary file not shown.
Binary file removed integration/options-types-only/options.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/options/options.bin
Binary file not shown.
Binary file removed integration/options/something/something.bin
Binary file not shown.
Binary file removed integration/output-decode-only/encode.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/output-encode-only/encode.bin
Binary file not shown.
Binary file removed integration/output-fromJSON-only/decode.bin
Binary file not shown.
Binary file removed integration/output-index/a.bin
Binary file not shown.
Binary file removed integration/output-toJSON-only/encode.bin
Binary file not shown.
Binary file removed integration/point/point.bin
Binary file not shown.
Binary file removed integration/proto2-long/simple.bin
Binary file not shown.
Binary file removed integration/proto2-no-default-vals/simple.bin
Binary file not shown.
Binary file removed integration/proto2-no-optionals/simple.bin
Binary file not shown.
Binary file removed integration/proto2/simple.bin
Binary file not shown.
20 changes: 0 additions & 20 deletions integration/protoc-gen-dump

This file was deleted.

1 change: 0 additions & 1 deletion integration/protoc-gen-dump.bat

This file was deleted.

2 changes: 2 additions & 0 deletions integration/protoc-gen-ts_proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../src/plugin')
Binary file not shown.
Binary file not shown.
Binary file removed integration/reserved-words/reserved-words.bin
Binary file not shown.
Binary file removed integration/return-observable/observable.bin
Binary file not shown.
Binary file removed integration/simple-deprecated-fields/simple.bin
Binary file not shown.
Binary file removed integration/simple-esmodule-interop/empty.bin
Binary file not shown.
Binary file removed integration/simple-esmodule-interop/simple.bin
Binary file not shown.
Binary file removed integration/simple-json-name/simple.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/simple-long-bigint/simple.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/simple-long-string/simple.bin
Binary file not shown.
Binary file removed integration/simple-long/google/protobuf/wrappers.bin
Binary file not shown.
Binary file removed integration/simple-long/simple.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/simple-optionals/import_dir/thing.bin
Binary file not shown.
Binary file removed integration/simple-optionals/simple.bin
Binary file not shown.
Binary file removed integration/simple-optionals/thing.bin
Binary file not shown.
Binary file removed integration/simple-proto2/simple.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed integration/simple-prototype-defaults/simple.bin
Binary file not shown.
Binary file not shown.
Binary file removed integration/simple-snake/import_dir/thing.bin
Binary file not shown.
Binary file removed integration/simple-snake/simple.bin
Binary file not shown.
Binary file removed integration/simple-string-enums/simple.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed integration/simple-unrecognized-enum/simple.bin
Binary file not shown.
Binary file removed integration/simple/google/protobuf/wrappers.bin
Binary file not shown.
Binary file removed integration/simple/google/type/date.bin
Binary file not shown.
Binary file removed integration/simple/import_dir/thing.bin
Binary file not shown.
Binary file removed integration/simple/simple.bin
Binary file not shown.
Binary file removed integration/static-only-type-registry/bar/bar.bin
Binary file not shown.
Binary file removed integration/static-only-type-registry/foo.bin
Binary file not shown.
Binary file removed integration/static-only/bar/bar.bin
Binary file not shown.
Binary file removed integration/static-only/foo.bin
Binary file not shown.
Binary file removed integration/struct/struct.bin
Binary file not shown.
1 change: 1 addition & 0 deletions integration/tsconfig.proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"angular",
"batching-with-context-esModuleInterop",
"import-mapping/mapping.ts",
"extension-import",
"simple-esmodule-interop",
"fieldoption-jstype*"
]
Expand Down
Binary file removed integration/type-annotations/bar/bar.bin
Binary file not shown.
Binary file removed integration/type-annotations/foo.bin
Binary file not shown.
Binary file removed integration/type-registry/bar/bar.bin
Binary file not shown.
Binary file removed integration/type-registry/foo.bin
Binary file not shown.
Binary file removed integration/types-with-underscores/file.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
29 changes: 0 additions & 29 deletions integration/update-bins.sh

This file was deleted.

Loading

0 comments on commit e2c149e

Please sign in to comment.