Skip to content

Commit

Permalink
Merge pull request #2337 from AllenInstitute/bugfix/2337-dont-create-…
Browse files Browse the repository at this point in the history
…c-miessave

Don't write into C:MiesSave during CI testing
  • Loading branch information
t-b authored Feb 3, 2025
2 parents ac37ee7 + a4bc35a commit 35b2d1f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Packages/MIES/MIES_Configuration.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static Function CONF_DefaultSettings()

JSON_AddString(jsonID, EXPCONFIG_JSON_POSITION_MCC, NONE)
JSON_AddString(jsonID, EXPCONFIG_JSON_STIMSET_NAME, "")
JSON_AddString(jsonID, EXPCONFIG_JSON_SAVE_PATH, "C:MiesSave")
JSON_AddString(jsonID, EXPCONFIG_JSON_SAVE_PATH, CONF_DEFAULT_SAVE_LOCATION)
JSON_AddBoolean(jsonID, EXPCONFIG_JSON_LOGFILE_UPLOAD, EXPCONFIG_JSON_LOGFILE_UPLOAD_DEFAULT)

jsonpath = "/" + EXPCONFIG_JSON_GLOBALPACKAGESETTINGBLOCK + "/" + PACKAGE_SETTINGS_USERPING
Expand Down
2 changes: 2 additions & 0 deletions Packages/MIES/MIES_Constants.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -2388,3 +2388,5 @@ Constant ABORTCODE_ABORT = -3
Constant ABORTCODE_STACKOVERFLOW = -2
Constant ABORTCODE_USERABORT = -1
///@}

StrConstant CONF_DEFAULT_SAVE_LOCATION = "C:MiesSave"
16 changes: 13 additions & 3 deletions Packages/tests/HardwareBasic/UTF_ConfigurationHardware.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,16 @@ End
/// IUTF_TD_GENERATOR s1:DeviceNameGenerator
static Function TCONF_CheckTypedPanelRestore([STRUCT IUTF_mData &md])

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

Execute/Q md.s0 + "()"
win = WinName(0, -1)
if(!CmpStr(win, BASE_WINDOW_NAME))
// special handling for DAEphys
KillWindow $win
device = md.s1
CreateLockedDAEphys(md.s1)
win = WinName(0, -1)
PGC_SetAndActivateControl(win, "check_Settings_RequireAmpConn", val = 0)
Expand All @@ -171,12 +173,20 @@ static Function TCONF_CheckTypedPanelRestore([STRUCT IUTF_mData &md])
PGC_SetAndActivateControl(win, "setvar_Settings_VC_DAgain", val = 20)
PGC_SetAndActivateControl(win, "Gain_AD_00", val = 0.0025)
PGC_SetAndActivateControl(win, "setvar_Settings_VC_ADgain", val = 0.0025)
needsFixup = 1
endif

CONF_SaveWindow(fName)
KillWindow $win

if(needsFixup)
[jsonID, rewrittenConfig] = FixupJSONConfig_IGNORE(fName, device)
JSON_Release(jsonID)
fName = rewrittenConfig
endif

CONF_RestoreWindow(fName)
winRestored = WinName(0, -1)
DeleteFile fName
CHECK_EQUAL_STR(win, winRestored)
End

Expand Down
3 changes: 3 additions & 0 deletions Packages/tests/UTF_HelperFunctions.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,9 @@ Function TestCaseEndCommon(string testcase, [variable restartAsyncFramework])
ASYNC_Start(ThreadProcessorCount, disableTask = 1)
endif
endif

INFO("The default save location for MIES json configuration \"%s\" must not exist for the tests.", s0 = CONF_DEFAULT_SAVE_LOCATION)
REQUIRE(!FolderExists(CONF_DEFAULT_SAVE_LOCATION))
End

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

0 comments on commit 35b2d1f

Please sign in to comment.