Skip to content

Commit

Permalink
* added check in tcbuild.bat that clean script does not make the repo…
Browse files Browse the repository at this point in the history
…sitory dirty (#3240)

* added check in tcbuild.bat that clean script does not make the repository dirty
* fixed removing WIFF auxiliary files for Unicode testing
* changed timstof_prm_scheduler.prmsqlite to be written to test directory instead of repo root
* updated .gitignore for SearchControlLog.txt and UserSettings.data (from WIFF2 SDK)
* added error message immediately after clean script for dirty repo
* added Thermo/x64 subdir to .gitignore
* added CleanBumbershoot.bat
* added src_subset to .gitignore (automatically cleaning it when the build is successful would be an alternative, but then if the build fails, it would be dirty for subsequent builds of different configs)
* added files to .gitignore either created by TeamCity or by older versions of the code (e.g. without the fixes to delete WIFF auxiliary files for Unicode testing)
  • Loading branch information
chambm authored Dec 2, 2024
1 parent 161badf commit 5211b18
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 68 deletions.
57 changes: 30 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ ASALocalRun/
*.nvuser

/build-nt-x86
/src_subset
/*.log
/libraries/boost_1_*
/libraries/expat*
Expand Down Expand Up @@ -391,6 +392,7 @@ Version.cpp
/pwiz_aux/msrc/utility/vendor_api/**/*.dll
/pwiz_aux/msrc/utility/vendor_api/*/EULA.*
/pwiz_aux/msrc/utility/vendor_api/ABI/LicenseKey.h
/pwiz_aux/msrc/utility/vendor_api/ABI/SCIEX.Apis.Data.v1.xml
/pwiz_aux/msrc/utility/vendor_api/Agilent/x64/
/pwiz_aux/msrc/utility/vendor_api/Agilent/x86/
/pwiz_aux/msrc/utility/vendor_api/Bruker/BAF2SQL-README.txt
Expand All @@ -403,6 +405,7 @@ Version.cpp
/pwiz_aux/msrc/utility/vendor_api/Shimadzu/*.xml
/pwiz_aux/msrc/utility/vendor_api/Shimadzu/*.txt
/pwiz_aux/msrc/utility/vendor_api/Waters/MassLynx*.h*
/pwiz_aux/msrc/utility/vendor_api/thermo/x64
/pwiz_aux/msrc/utility/vendor_api/thermo/ThermoFisher.CommonCore.RawFileReader.xml
/pwiz_aux/msrc/utility/vendor_api/thermo/ThermoFisher.CommonCore.MassPrecisionEstimator.xml
/pwiz_aux/msrc/utility/vendor_api/thermo/ThermoFisher.CommonCore.Data.xml
Expand All @@ -420,32 +423,16 @@ SkylineTester Results
/bs32.bat
/bso64.bat
/bso32.bat
/qb64.bat
/SignAfterPublishPW.bat
/OnyxTOFMS.试验.wiff.scan
/160109_Mix1_calcurve_074_raw.skyl
/160109_Mix1_calcurve_074_raw.skyd
/160109_Mix1_calcurve_074_raw
/160109_Mix1_calcurve_073_mzML.skyl
/160109_Mix1_calcurve_073_mzML.skyd
/160109_Mix1_calcurve_073_mzML
/160109_Mix1_calcurve_071_raw.skyl
/160109_Mix1_calcurve_071_raw.skyd
/160109_Mix1_calcurve_071_raw
/160109_Mix1_calcurve_070_mzML.skyl
/160109_Mix1_calcurve_070_mzML.skyd
/160109_Mix1_calcurve_070_mzML
/REP02_CE_Vantage_15mTorr_0001_REP2_02_raw.skyl
/REP02_CE_Vantage_15mTorr_0001_REP2_02_raw.skyd
/REP02_CE_Vantage_15mTorr_0001_REP2_02_raw
/REP02_CE_Vantage_15mTorr_0001_REP2_01_raw.skyl
/REP02_CE_Vantage_15mTorr_0001_REP2_01_raw.skyd
/REP02_CE_Vantage_15mTorr_0001_REP2_01_raw
/REP01_CE_Vantage_15mTorr_0001_REP1_02_raw.skyl
/REP01_CE_Vantage_15mTorr_0001_REP1_02_raw.skyd
/REP01_CE_Vantage_15mTorr_0001_REP1_02_raw
/REP01_CE_Vantage_15mTorr_0001_REP1_01_raw.skyl
/REP01_CE_Vantage_15mTorr_0001_REP1_01_raw.skyd
/REP01_CE_Vantage_15mTorr_0001_REP1_01_raw
/160109_Mix1_calcurve_074_raw*
/160109_Mix1_calcurve_073_mzML*
/160109_Mix1_calcurve_071_raw*
/160109_Mix1_calcurve_070_mzML*
/REP02_CE_Vantage_15mTorr_0001_REP2_02_raw*
/REP02_CE_Vantage_15mTorr_0001_REP2_01_raw*
/REP01_CE_Vantage_15mTorr_0001_REP1_02_raw*
/REP01_CE_Vantage_15mTorr_0001_REP1_01_raw*
/pwiz_tools/Skyline/Properties/AssemblyInfo.cs
/pwiz_tools/Skyline/SkylineCmd/Properties/AssemblyInfo.cs
/pwiz_tools/Skyline/SkylineNightly/Properties/AssemblyInfo.cs
Expand All @@ -457,8 +444,24 @@ SkylineTester Results
/pwiz_tools/Skyline/SignAfterPublishPW.bat
/BrowseOnly
/x64/BrowseOnly
/qb64.bat
/pwiz_tools/Skyline/Test/ProtocolBuffers/GeneratedCode/*.cs
/pwiz_tools/Skyline/Test/ProtocolBuffers/tmp/*.cs
/pwiz_tools/Skyline/Test/ProtocolBuffers/tmp
/pwiz_aux/msrc/utility/vendor_api/ABI/SCIEX.Apis.Data.v1.xml
/SearchControlLog.txt

# created by WIFF2 SDK in working directory
/UserSettings.data
/UserSettings.data-journal

# created by TeamCity for Skyline versions that need PrositConfig.xml
/pwiz_tools/Skyline/Model/Prosit/

# created by older versions of the code in the working directory
/Enolase_repeats_AQv1.4.2*
/PressureTrace1*
/timstof_prm_scheduler.prmsqlite

# created by tc-perftests.bat
/perfTestNames.txt
/tutorialTestNames.txt
/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ int main(int argc, char* argv[])

try
{
bfs::current_path(bfs::path(testArgs[0]).parent_path()); // set working directory to test exe location
if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
if (os_) *os_ << "PrmSchedulerTest\n";

Expand Down
56 changes: 15 additions & 41 deletions pwiz/utility/misc/VendorReaderTestHarness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ void testRead(const Reader& reader, const string& rawpath, const bfs::path& pare
bfs::path::string_type unicodeTestString(boost::locale::conv::utf_to_utf<bfs::path::value_type>(L"-试验"));
bfs::path rawpathPath(rawpath);
bfs::path newRawPath = bfs::current_path() / rawpathPath.filename();
vector<bfs::path> extraCopiedPaths;
const auto& oldExtension = newRawPath.extension().native();
newRawPath = newRawPath.replace_extension().native() + unicodeTestString + newRawPath.extension().native();
if (bfs::exists(newRawPath))
Expand All @@ -571,37 +572,19 @@ void testRead(const Reader& reader, const string& rawpath, const bfs::path& pare
// special case for wiff files with accompanying .scan files
if (bal::iends_with(rawpath, ".wiff") || bal::iends_with(rawpath, ".wiff2"))
{
bfs::path wiffscanPath(rawpathPath);
wiffscanPath.replace_extension(".wiff.scan");
if (bfs::exists(wiffscanPath))
for (auto ext : { L".wiff.scan", L".dad.scan", L".dad.sidx" })
{
bfs::path newWiffscanPath = bfs::current_path() / rawpathPath.filename(); // replace_extension won't work as desired on wiffscanPath
newWiffscanPath = newWiffscanPath.replace_extension().native() + unicodeTestString + boost::locale::conv::utf_to_utf<bfs::path::value_type>(L".wiff.scan");
if (bfs::exists(newWiffscanPath))
bfs::remove(newWiffscanPath);
bfs::copy_file(wiffscanPath, newWiffscanPath);
}

wiffscanPath = rawpathPath;
wiffscanPath.replace_extension(".dad.scan");
if (bfs::exists(wiffscanPath))
{
bfs::path newWiffscanPath = bfs::current_path() / rawpathPath.filename(); // replace_extension won't work as desired on wiffscanPath
newWiffscanPath = newWiffscanPath.replace_extension().native() + unicodeTestString + boost::locale::conv::utf_to_utf<bfs::path::value_type>(L".dad.scan");
if (bfs::exists(newWiffscanPath))
bfs::remove(newWiffscanPath);
bfs::copy_file(wiffscanPath, newWiffscanPath);
}

wiffscanPath = rawpathPath;
wiffscanPath.replace_extension(".dad.sidx");
if (bfs::exists(wiffscanPath))
{
bfs::path newWiffscanPath = bfs::current_path() / rawpathPath.filename(); // replace_extension won't work as desired on wiffscanPath
newWiffscanPath = newWiffscanPath.replace_extension().native() + unicodeTestString + boost::locale::conv::utf_to_utf<bfs::path::value_type>(L".dad.sidx");
if (bfs::exists(newWiffscanPath))
bfs::remove(newWiffscanPath);
bfs::copy_file(wiffscanPath, newWiffscanPath);
bfs::path wiffscanPath(rawpathPath);
wiffscanPath.replace_extension(ext);
if (bfs::exists(wiffscanPath))
{
bfs::path newWiffscanPath = bfs::current_path() / rawpathPath.filename(); // replace_extension won't work as desired on wiffscanPath
newWiffscanPath = newWiffscanPath.replace_extension().native() + unicodeTestString + boost::locale::conv::utf_to_utf<bfs::path::value_type>(ext);
if (bfs::exists(newWiffscanPath))
bfs::remove(newWiffscanPath);
bfs::copy_file(wiffscanPath, newWiffscanPath);
extraCopiedPaths.emplace_back(newWiffscanPath);
}
}
}
bfs::copy_file(rawpathPath, newRawPath);
Expand Down Expand Up @@ -682,17 +665,8 @@ void testRead(const Reader& reader, const string& rawpath, const bfs::path& pare
bfs::remove_all(newRawPath); // remove the copy of the RAW file with non-ASCII characters

// special case for wiff files with accompanying .scan files
if (bal::iequals(rawpathPath.extension().string(), ".wiff"))
{
bfs::path wiffscanPath(rawpathPath);
wiffscanPath.replace_extension(".wiff.scan");
if (bfs::exists(wiffscanPath))
{
bfs::path newWiffscanPath = bfs::current_path() / rawpathPath.filename(); // replace_extension won't work as desired on wiffscanPath
newWiffscanPath.replace_extension(unicodeTestString + boost::locale::conv::utf_to_utf<bfs::path::value_type>(L".wiff.scan"));
bfs::remove(newWiffscanPath);
}
}
for (auto extraPath : extraCopiedPaths)
bfs::remove(extraPath);
}
catch (bfs::filesystem_error& e)
{
Expand Down
24 changes: 24 additions & 0 deletions pwiz_tools/Bumbershoot/CleanBumbershoot.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@echo off
setlocal
@echo off

REM # Get the location of this script and drop trailing slash
set SCRIPT_ROOT=%~dp0
set SCRIPT_ROOT=%SCRIPT_ROOT:~0,-1%
pushd %SCRIPT_ROOT%

FOR /r %%I IN (*Version.cpp) DO del "%%I"
IF EXIST idpicker\build-nt-x86 rmdir /s /q idpicker\build-nt-x86
IF EXIST idpicker\packages rmdir /s /q idpicker\packages

IF EXIST greazy\GUI\Properties\AssemblyInfo.cs del /q greazy\GUI\Properties\AssemblyInfo.cs
IF EXIST idpicker\Controls\Properties\AssemblyInfo.cs del /q idpicker\Controls\Properties\AssemblyInfo.cs
IF EXIST idpicker\CustomDataSourceDialog\Properties\AssemblyInfo.cs del /q idpicker\CustomDataSourceDialog\Properties\AssemblyInfo.cs
IF EXIST idpicker\Model\Properties\AssemblyInfo.cs del /q idpicker\Model\Properties\AssemblyInfo.cs
IF EXIST idpicker\Qonverter\CLI\AssemblyInfo.cpp del /q idpicker\Qonverter\CLI\AssemblyInfo.cpp
IF EXIST idpicker\Util\Properties\AssemblyInfo.cs del /q idpicker\Util\Properties\AssemblyInfo.cs
IF EXIST idpicker\Properties\AssemblyInfo.cs del /q idpicker\Properties\AssemblyInfo.cs
IF EXIST idpicker\Resources\Resources.rc del /q idpicker\Resources\Resources.rc
IF EXIST idpicker\Resources\Resources.res del /q idpicker\Resources\Resources.res

popd
2 changes: 2 additions & 0 deletions pwiz_tools/clean-apps.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ call :CleanBinaries Shared
call :CleanBinaries Skyline
call :CleanBinaries SeeMS
call :CleanBinaries MSConvertGUI
call :CleanBinaries Bumbershoot

IF EXIST Shared\CommonTest rmdir /s/q Shared\CommonTest

IF EXIST SeeMS\CleanSeeMS.bat call SeeMS\CleanSeeMS.bat
IF EXIST Skyline\CleanSkyline.bat call Skyline\CleanSkyline.bat
IF EXIST BiblioSpec\CleanBiblioSpec.bat call BiblioSpec\CleanBiblioSpec.bat
IF EXIST Bumbershoot\CleanBumbershoot.bat call Bumbershoot\CleanBumbershoot.bat

popd
rem Exit the script
Expand Down
6 changes: 6 additions & 0 deletions scripts/misc/tcbuild-apps.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ call clean.bat
set EXIT=%ERRORLEVEL%
if %EXIT% NEQ 0 set ERROR_TEXT=Error performing clean & goto error

REM # check clean did not dirty repo (but postpone error until after quickbuild)
set CLEAN_EXIT=0
git status --porcelain | findstr . && set CLEAN_EXIT=1
if %CLEAN_EXIT% NEQ 0 echo Repository is dirty after clean script >&2

REM # the -p1 argument overrides bjam's default behavior of merging stderr into stdout
REM # the --abbreviate-paths argument abbreviates paths like .../ftr1-value/ftr2-value/...

Expand All @@ -43,6 +48,7 @@ echo quickbuild.bat %ALL_ARGS% -p1 --abbreviate-paths --teamcity-test-decoration
call quickbuild.bat %ALL_ARGS% -p1 --abbreviate-paths --teamcity-test-decoration --without-compassxtract
set EXIT=%ERRORLEVEL%
if %EXIT% NEQ 0 set ERROR_TEXT=Error running quickbuild & goto error
if %CLEAN_EXIT% NEQ 0 set EXIT=%CLEAN_EXIT% & set ERROR_TEXT=Repository was dirty after clean script & goto error

popd

Expand Down
6 changes: 6 additions & 0 deletions scripts/misc/tcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pushd %SCRIPTS_MISC_ROOT%\..\..
set EXIT=0
set ALL_ARGS=%*
set CLEAN=1
set CLEAN_EXIT=0

if "%ALL_ARGS: no-clean=%" neq "%ALL_ARGS%" (
set CLEAN=0
Expand All @@ -22,6 +23,10 @@ if %CLEAN%==1 (
call clean.bat
set EXIT=%ERRORLEVEL%
if %EXIT% NEQ 0 set ERROR_TEXT=Error performing clean & goto error

REM # check clean did not dirty repo (but postpone error until after quickbuild)
git status --porcelain | findstr . && set CLEAN_EXIT=1
if %CLEAN_EXIT% NEQ 0 echo Repository is dirty after clean script >&2
)

REM # the -p1 argument overrides bjam's default behavior of merging stderr into stdout
Expand All @@ -32,6 +37,7 @@ echo ##teamcity[progressMessage 'Running quickbuild...']
call quickbuild.bat -p1 --abbreviate-paths --teamcity-test-decoration --verbose-test %ALL_ARGS%
set EXIT=%ERRORLEVEL%
if %EXIT% NEQ 0 set ERROR_TEXT=Error running quickbuild & goto error
if %CLEAN_EXIT% NEQ 0 set EXIT=%CLEAN_EXIT% & set ERROR_TEXT=Repository was dirty after clean script & goto error

REM # uncomment this to test that test failures and error output are handled properly
REM call quickbuild.bat -p1 --teamcity-test-decoration pwiz/utility/misc//FailUnitTest pwiz/utility/misc//FailRunTest
Expand Down

0 comments on commit 5211b18

Please sign in to comment.