Skip to content

Commit 35b2d1f

Browse files
authored
Merge pull request #2337 from AllenInstitute/bugfix/2337-dont-create-c-miessave
Don't write into C:MiesSave during CI testing
2 parents ac37ee7 + a4bc35a commit 35b2d1f

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

Packages/MIES/MIES_Configuration.ipf

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static Function CONF_DefaultSettings()
255255

256256
JSON_AddString(jsonID, EXPCONFIG_JSON_POSITION_MCC, NONE)
257257
JSON_AddString(jsonID, EXPCONFIG_JSON_STIMSET_NAME, "")
258-
JSON_AddString(jsonID, EXPCONFIG_JSON_SAVE_PATH, "C:MiesSave")
258+
JSON_AddString(jsonID, EXPCONFIG_JSON_SAVE_PATH, CONF_DEFAULT_SAVE_LOCATION)
259259
JSON_AddBoolean(jsonID, EXPCONFIG_JSON_LOGFILE_UPLOAD, EXPCONFIG_JSON_LOGFILE_UPLOAD_DEFAULT)
260260

261261
jsonpath = "/" + EXPCONFIG_JSON_GLOBALPACKAGESETTINGBLOCK + "/" + PACKAGE_SETTINGS_USERPING

Packages/MIES/MIES_Constants.ipf

+2
Original file line numberDiff line numberDiff line change
@@ -2388,3 +2388,5 @@ Constant ABORTCODE_ABORT = -3
23882388
Constant ABORTCODE_STACKOVERFLOW = -2
23892389
Constant ABORTCODE_USERABORT = -1
23902390
///@}
2391+
2392+
StrConstant CONF_DEFAULT_SAVE_LOCATION = "C:MiesSave"

Packages/tests/HardwareBasic/UTF_ConfigurationHardware.ipf

+13-3
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,16 @@ End
155155
/// IUTF_TD_GENERATOR s1:DeviceNameGenerator
156156
static Function TCONF_CheckTypedPanelRestore([STRUCT IUTF_mData &md])
157157

158-
string win, winRestored
159-
string fName = GetFolder(FunctionPath("")) + "CheckTypedPanelRestore.json"
158+
string win, winRestored, rewrittenConfig, device
159+
variable jsonID, needsFixup
160+
string fName = PrependExperimentFolder_IGNORE("CheckTypedPanelRestore.json")
160161

161162
Execute/Q md.s0 + "()"
162163
win = WinName(0, -1)
163164
if(!CmpStr(win, BASE_WINDOW_NAME))
164165
// special handling for DAEphys
165166
KillWindow $win
167+
device = md.s1
166168
CreateLockedDAEphys(md.s1)
167169
win = WinName(0, -1)
168170
PGC_SetAndActivateControl(win, "check_Settings_RequireAmpConn", val = 0)
@@ -171,12 +173,20 @@ static Function TCONF_CheckTypedPanelRestore([STRUCT IUTF_mData &md])
171173
PGC_SetAndActivateControl(win, "setvar_Settings_VC_DAgain", val = 20)
172174
PGC_SetAndActivateControl(win, "Gain_AD_00", val = 0.0025)
173175
PGC_SetAndActivateControl(win, "setvar_Settings_VC_ADgain", val = 0.0025)
176+
needsFixup = 1
174177
endif
178+
175179
CONF_SaveWindow(fName)
176180
KillWindow $win
181+
182+
if(needsFixup)
183+
[jsonID, rewrittenConfig] = FixupJSONConfig_IGNORE(fName, device)
184+
JSON_Release(jsonID)
185+
fName = rewrittenConfig
186+
endif
187+
177188
CONF_RestoreWindow(fName)
178189
winRestored = WinName(0, -1)
179-
DeleteFile fName
180190
CHECK_EQUAL_STR(win, winRestored)
181191
End
182192

Packages/tests/UTF_HelperFunctions.ipf

+3
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,9 @@ Function TestCaseEndCommon(string testcase, [variable restartAsyncFramework])
908908
ASYNC_Start(ThreadProcessorCount, disableTask = 1)
909909
endif
910910
endif
911+
912+
INFO("The default save location for MIES json configuration \"%s\" must not exist for the tests.", s0 = CONF_DEFAULT_SAVE_LOCATION)
913+
REQUIRE(!FolderExists(CONF_DEFAULT_SAVE_LOCATION))
911914
End
912915

913916
Function SetAsyncChannelProperties(string device, WAVE asyncChannels, variable minValue, variable maxValue)

0 commit comments

Comments
 (0)