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

[ISSUE-244] Fixed error with existing files in pulled screenshot folder #271

Merged

Conversation

mariuszmarzec
Copy link
Contributor

@mariuszmarzec mariuszmarzec commented Dec 20, 2021

📌 References

🎩 What is the goal?

Fixing error with existing files in pulled screenshot folder for regular and compose tests.

How is it being implemented?

  • Added removing pulledScreenshotFolder before downloading screenshots
  • Removing both regular and compose pulledScreenshotFolder
  • Added configuration of separation char in ShotFolder class

How can it be tested?

  • Use case 1: Run test for shot
    • gradlew test
  • Use case 2: Run in all shot-consumer-*
    • gradlew publishToMavenLocal
    • gradlew executeScreenshot -Precord
    • gradlew executeScreenshot

@@ -41,9 +37,7 @@ class Shot(

def recordScreenshots(
appId: AppId,
shotFolder: ShotFolder,
projectName: String
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed due tu unnecessary

FileUtils.deleteDirectory(projectTemporalScreenshots)
}
FileUtils.deleteDirectory(new File(shotFolder.pulledScreenshotsFolder()))
FileUtils.deleteDirectory(new File(shotFolder.pulledComposeScreenshotsFolder()))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleteDirectory method is checking if dir exists under the hood

@@ -7,25 +7,26 @@ case class ShotFolder(
private val buildFolderPath: FilePath,
private val buildType: String,
private val flavor: Option[String],
private val directorySuffix: Option[String]
private val directorySuffix: Option[String],
private val separator: String
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding separator in ShotFolder is necessary due to in moveComposeScreenshotsToRegularScreenshotsFolder 145 line there is replace fragment of file's path. It didn't work on Windows according to different slash.

Copy link
Owner

@pedrovgs pedrovgs left a comment

Choose a reason for hiding this comment

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

Well done @mariuszmarzec thank you so much for your help 😃

@pedrovgs pedrovgs merged commit 4929fbb into pedrovgs:master Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants