| 62 | } |
| 63 | |
| 64 | void TestReadDataset(const TReadDatasetTestCase& testCase) { |
| 65 | TReadDatasetMainParams readDatasetMainParams; |
| 66 | |
| 67 | // TODO(akhropov): temporarily use THolder until TTempFile move semantic are fixed |
| 68 | TVector<THolder<TTempFile>> srcDataFiles; |
| 69 | |
| 70 | SaveSrcData(testCase.SrcData, &readDatasetMainParams, &srcDataFiles); |
| 71 | |
| 72 | NPar::TLocalExecutor localExecutor; |
| 73 | localExecutor.RunAdditionalThreads(3); |
| 74 | |
| 75 | auto readDataset = [&] () { |
| 76 | return ReadDataset( |
| 77 | /*taskType*/Nothing(), |
| 78 | readDatasetMainParams.PoolPath, |
| 79 | readDatasetMainParams.PairsFilePath, // can be uninited |
| 80 | readDatasetMainParams.GraphFilePath, // can be uninited |
| 81 | readDatasetMainParams.GroupWeightsFilePath, // can be uninited |
| 82 | /*timestampsFilePath*/TPathWithScheme(), |
| 83 | readDatasetMainParams.BaselineFilePath, // can be uninited |
| 84 | readDatasetMainParams.FeatureNamesFilePath, // can be uninited |
| 85 | /*poolMetaInfoFilePath*/TPathWithScheme(), |
| 86 | readDatasetMainParams.ColumnarPoolFormatParams, |
| 87 | testCase.SrcData.IgnoredFeatures, |
| 88 | testCase.SrcData.ObjectsOrder, |
| 89 | TDatasetSubset::MakeColumns(), |
| 90 | /*loadSampleIds*/ false, |
| 91 | /*forceUnitAutoPairWeights*/ true, |
| 92 | /*classLabels*/Nothing(), |
| 93 | &localExecutor |
| 94 | ); |
| 95 | }; |
| 96 | |
| 97 | if (testCase.ExpectedReadError) { |
| 98 | UNIT_ASSERT_EXCEPTION(readDataset(), TCatBoostException); |
| 99 | } else { |
| 100 | TDataProviderPtr dataProvider = readDataset(); |
| 101 | Compare<TRawObjectsDataProvider>(std::move(dataProvider), testCase.ExpectedData); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | |
| 106 | void TestSampleDataset(const TSampleDatasetTestCase& testCase) { |
no test coverage detected