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

Integration test for uploading source bundles in empty project #105

Merged
merged 1 commit into from
Jan 27, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ class SentryCliWhitespacesTestIT {
verifier.resetStreams()
}

@Test
fun buildsSuccessfullyWithNoSourceRootAndLogs() {
val cliPath = SentryCliProvider.getCliPath(MavenProject(), null)
val baseDir = setupEmptyProject()

val path = getPOM(baseDir, sentryCliPath = cliPath)

val verifier = Verifier(path)
verifier.isAutoclean = false
verifier.executeGoal("install")
verifier.verifyErrorFreeLog()
verifier.verifyTextInLog("Skipping module, as it doesn't have any source roots")
}

private fun setupProject(): File {
val baseDir = File(file, "base with spaces")
val srcDir = File(baseDir, "/src/main/java")
Expand All @@ -97,6 +111,16 @@ class SentryCliWhitespacesTestIT {
return baseDir
}

private fun setupEmptyProject(): File {
val baseDir = File(file, "empty-base-dir")
val baseDirResult = baseDir.mkdir()

assertTrue(baseDirResult, "Error creating base directory")
installMavenWrapper(baseDir, "3.8.6")

return baseDir
}

private fun getUploadedBundleIdFromLog(output: String): String? {
val uploadedIdRegex = """\w+":\{"state":"ok","missingChunks":\[],"uploaded_id":"(\w+-\w+-\w+-\w+-\w+)""".toRegex()
return uploadedIdRegex.find(output)?.groupValues?.get(1)
Expand Down
Loading