@heeheehee
I looked at the security scan and saw a user controlled file name in Preferences. I thought I would look at it. I made a new local branch. I ran IntelliJ's inspect and found a couple of things I thought I should change and then did so. I then looked at jacoco coverage and found a couple of routines with no coverage. They were private and so I decided to test them implicitly by calling something public that called them. That was the function that actually did IO so I started a new test that set Preferences.saveSettingsToFile=true and used username of my choice. Things were going fine until I looked at test\root\settings and saw a lot of clutter there. I saw the files I expected for my user and GLOBAL_prefs.txt which had the potential to bleed across tests. So I whacked all of the files in test\root\settings. I ran and got test failures from PreferencesTest. I had a WTF moment so I stashed my changes and switched back to main. test\root\settings remained empty, as expected since none of the files are "checked in". gradlew clean and gradle test run so quickly that I don't believe anything was actually running.
I set
org.gradle.caching=false
org.gradle.parallel=false
and tests ran and files were created in test\root\settings
Question 1 - could we have a gradle task the deleted the cache so I don't have to go into gradle.properties to bypass it? Maybe gradle clean invalidates all caches as well?
Question 2 - is it reasonable for me to modify (at least) Preferences tests so that test\root\settings is empty when they are over and perhaps cleared out between tests? That will, at least, convince me that it is not leakage from my new test that broke the old ones.
Question 3 - will I be forgiven if my PR, when finally pushed fails the OS tests? Obviously I would need to fix things before the PR got any serious attention
I looked at the security scan and saw a user controlled file name in Preferences. I thought I would look at it. I made a new local branch. I ran IntelliJ's inspect and found a couple of things I thought I should change and then did so. I then looked at jacoco coverage and found a couple of routines with no coverage. They were private and so I decided to test them implicitly by calling something public that called them. That was the function that actually did IO so I started a new test that set Preferences.saveSettingsToFile=true and used username of my choice. Things were going fine until I looked at test\root\settings and saw a lot of clutter there. I saw the files I expected for my user and GLOBAL_prefs.txt which had the potential to bleed across tests. So I whacked all of the files in test\root\settings. I ran and got test failures from PreferencesTest. I had a WTF moment so I stashed my changes and switched back to main. test\root\settings remained empty, as expected since none of the files are "checked in". gradlew clean and gradle test run so quickly that I don't believe anything was actually running.
I set
org.gradle.caching=false
org.gradle.parallel=false
and tests ran and files were created in test\root\settings
Question 1 - could we have a gradle task the deleted the cache so I don't have to go into gradle.properties to bypass it? Maybe gradle clean invalidates all caches as well?
Question 2 - is it reasonable for me to modify (at least) Preferences tests so that test\root\settings is empty when they are over and perhaps cleared out between tests? That will, at least, convince me that it is not leakage from my new test that broke the old ones.
Question 3 - will I be forgiven if my PR, when finally pushed fails the OS tests? Obviously I would need to fix things before the PR got any serious attention
