Skip to content

Commit

Permalink
small tweaks post rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-codecov committed Mar 5, 2024
1 parent 90582e6 commit 6799747
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/bundler-plugin-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function codecovUnpluginFactory({
sentryHub?.captureSession();

Check warning on line 61 in packages/bundler-plugin-core/src/index.ts

View check run for this annotation

Codecov - Staging / codecov/patch

packages/bundler-plugin-core/src/index.ts#L60-L61

Added lines #L60 - L61 were not covered by tests

Check warning on line 61 in packages/bundler-plugin-core/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/bundler-plugin-core/src/index.ts#L60-L61

Added lines #L60 - L61 were not covered by tests

let sentEndSession = false; // Just to prevent infinite loops with beforeExit, which is called whenever the event loop empties out

Check warning on line 63 in packages/bundler-plugin-core/src/index.ts

View check run for this annotation

Codecov - Staging / codecov/patch

packages/bundler-plugin-core/src/index.ts#L63

Added line #L63 was not covered by tests

Check warning on line 63 in packages/bundler-plugin-core/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/bundler-plugin-core/src/index.ts#L63

Added line #L63 was not covered by tests
// We also need to manually end sesisons on errors because beforeExit is not called on crashes
// We also need to manually end sessions on errors because beforeExit is not called on crashes
process.on("beforeExit", () => {

Check warning on line 65 in packages/bundler-plugin-core/src/index.ts

View check run for this annotation

Codecov - Staging / codecov/patch

packages/bundler-plugin-core/src/index.ts#L65

Added line #L65 was not covered by tests

Check warning on line 65 in packages/bundler-plugin-core/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/bundler-plugin-core/src/index.ts#L65

Added line #L65 was not covered by tests
if (!sentEndSession) {
sentryHub?.endSession();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const tests: Test[] = [
success: true,
options: {
bundleName: "test-bundle",
telemetry: true,
apiUrl: "https://api.codecov.io",
dryRun: false,
retryCount: 3,
Expand All @@ -40,6 +41,7 @@ const tests: Test[] = [
dryRun: true,
retryCount: 1,
enableBundleAnalysis: true,
telemetry: false,
uploadToken: "test-token",
uploadOverrides: {
branch: "test-branch",
Expand All @@ -58,6 +60,7 @@ const tests: Test[] = [
dryRun: true,
retryCount: 1,
enableBundleAnalysis: true,
telemetry: false,
uploadToken: "test-token",
uploadOverrides: {
branch: "test-branch",
Expand Down
3 changes: 3 additions & 0 deletions packages/bundler-plugin-core/src/utils/normalizeOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ const optionsSchemaFactory = (options: Options) =>
.string({ invalid_type_error: "`uploadToken` must be a string." })
.optional(),
uploadOverrides: UploadOverridesSchema.optional(),
telemetry: z
.boolean({ invalid_type_error: "`telemetry` must be a boolean." })
.default(true),
sentry: z
.object({
sentryOnly: z
Expand Down
31 changes: 24 additions & 7 deletions pnpm-lock.yaml

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

0 comments on commit 6799747

Please sign in to comment.