Add ability to merge datasets
See original GitHub issueCase:
- Meta dataset is defined and includes several dataset files are common for all tests.
- Any test is needed its specific dataset in addition to common data in meta dataset.
DataSet in test is override metadataset.
I think it’s a good idea to make some dataset mode flags to manage included datasets, for example:
/*Meta dataset with common data*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@DataSet(value = {"SomeData1.xml", "SomeData2.xml", "SomeData3.xml"},
strategy = SeedStrategy.CLEAN_INSERT)
public @interface MetaDataset {
}
@MetaDataset
public class SomeDaoTest {
...
@Test
@DataSet(value = "before-update.xml", mode=DatasetMergeMode .DATASET)
@ExpectedDataSet(value = "after-update.xml")
public void updateTest() {
...
}
@Test
@DataSet(value = "before-delete.xml", mode=DatasetMergeMode .DATASET)
@ExpectedDataSet(value = "after-delete.xml")
public void deleteTest() {
...
}
}
Possible modes can affect all dataset parameters:
class DatasetMergeMode {
public static final int DATASET = 1;
public static final int BEFORE_STATEMENTS= 2;
public static final int AFTER_STATEMENTS = 4;
.....
}
Because default behavior is “override”, only merge is interested.
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (18 by maintainers)
Top Results From Across the Web
Combining Datasets: Merge and Join | Python Data Science ...
The pd.merge() function recognizes that each DataFrame has an "employee" column, and automatically joins using this column as a key. The result of ......
Read more >How to COMBINE DATA with MERGE and APPEND in Power BI
Learn how to use merge and append to combine data sets in Power BI.
Read more >How to Append / Combine two datasets Power BI ... - YouTube
How to combine two datasets In Power BI, We explained in which business scenario you will combine / Append data in Power BI,...
Read more >Merge queries and join tables - Microsoft Support
Merge queries and join tables ; Sales Data worksheet, open Power Query, and then select ; Home > ; Combine > ; Merge...
Read more >Merging Datasets in R - DataCamp
At the high level, there are two ways you can merge datasets; you can add information by adding more rows or by adding...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I think merging datasets on annotations, classes and methods is good idea in some cases, but configuring priorities and modes are overcomplication. We can start with choosing good default merging behaviour.
Agreed! For my opinion datasets on annotation must be specified for common setup like filling reference data, while datasets on methods are more test specific. What do you think about such ordering?
Hi folks, I’ve opened the PR #94, it would be nice if someone could have a look and also try it locally.
Thank you so far!