Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build-tools] skip throwing MAVEN_CACHE_ERROR if Could not find BlurView-version-2.0.3.jar line is present #505

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,46 @@ note`;
- The last one
Refer to "Xcode Logs" below for additional, more detailed logs.`);
});

it('detects MAVEN_CACHE_ERROR correctly', async () => {
const err = await resolveBuildPhaseErrorAsync(
new Error(),
[`https://szymon.pl/maven/cache`],
{
job: { platform: Platform.ANDROID, mode: BuildMode.BUILD } as Job,
phase: BuildPhase.RUN_GRADLEW,
env: {
EAS_BUILD_MAVEN_CACHE_URL: 'https://szymon.pl/maven/cache',
},
},
'/fake/path'
);

expect(err.errorCode).toBe('MAVEN_CACHE_ERROR');
expect(err.userFacingErrorCode).toBe('EAS_BUILD_UNKNOWN_GRADLE_ERROR');
expect(err.userFacingMessage).toBe(
`Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.`
);
});

it('does not throw MAVEN_CACHE_ERROR if "Could not find BlurView-version-2.0.3.jar" log is present', async () => {
const err = await resolveBuildPhaseErrorAsync(
new Error(),
[`Could not find BlurView-version-2.0.3.jar sth sthelse https://szymon.pl/maven/cache`],
{
job: { platform: Platform.ANDROID, mode: BuildMode.BUILD } as Job,
phase: BuildPhase.RUN_GRADLEW,
env: {
EAS_BUILD_MAVEN_CACHE_URL: 'https://szymon.pl/maven/cache',
},
},
'/fake/path'
);

expect(err.errorCode).toBe('EAS_BUILD_UNKNOWN_GRADLE_ERROR');
expect(err.userFacingErrorCode).toBe('EAS_BUILD_UNKNOWN_GRADLE_ERROR');
expect(err.userFacingMessage).toBe(
`Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.`
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,11 @@ export const buildErrorHandlers: ErrorHandler<TrackedBuildError>[] = [
phase: BuildPhase.RUN_GRADLEW,
regexp: ({ env }: ErrorContext) =>
env.EAS_BUILD_MAVEN_CACHE_URL
? new RegExp(escapeRegExp(env.EAS_BUILD_MAVEN_CACHE_URL))
? new RegExp(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be worth it to add a comment with context for this regex

`^(?!.*Could not find BlurView-version-2\\.0\\.3\\.jar).*${escapeRegExp(
env.EAS_BUILD_MAVEN_CACHE_URL
)}`
)
: undefined,
createError: () => new TrackedBuildError('MAVEN_CACHE_ERROR', `maven: cache error`),
},
Expand Down
Loading