Manage test cases
In the Test Cases section of the Entity Groups page, you can click through to individual test cases, see when tests were last run and which ones passed or failed, and you can enable or disable test cases.
To view an individual test case’s results, click the test case link in the list. The test case page opens with detailed information.
Drilling down through test cases
To enable or disable individual test cases for the current entity group, click the corresponding checkbox in the ENABLED? column of the table.
You can enable or disable all test cases by clicking the checkbox next to the column heading.
Ensure that you click the Save button at the top of the page to save your changes.
Adding or updating test cases
To create and add a test case, at the bottom of the test case list, click the +Add Test Case link.
The test case page displays the query editor containing the query that defines the test case conditions, as well as a list of the entity groups and their corresponding results for the test case. Best practice is to have fewer than 250 test cases, to minimize run and preview times.
From the test case page, you can perform the following actions:
- Define the name, description and query for the test case.
- Add users to receive email notifications for the test case.
- Define the failure condition and threshold.
- Drill through to entity groups.
- Enable entity groups to run for the test case.
- Add entity groups to the test case.
- Customize or add language translations.
Note: Common test case names should follow a convention; for example, all address checks should include address in the name. This will make it easier to filter results in the dashboard.
Create or update the test case query
The query editor used for editing test cases includes the same functionality as the advanced query editor for Network Reporting. The query editor offers tools for auto completion, as well as easy access to quick lists of available keywords, tables, fields, and operators. As you construct your query, the editor automatically validates it.
Rules for defining test cases
When you add or update a test case, the following rules apply:
- SELECT statements must include
- Address, License, and ParentHCO queries must include
- UNIONS are only allowed in sub-queries
- No semicolon at end of the query
SELECT entity_vid__v, vid__v, formatted_address__v, address_status__v, record_state__v, address_type__v, created_date__v, modified_date__v, is_veeva_master__v FROM ADDRESS WHERE coalesce(address_type__v, '') = ''
Add or update a test case query
If you are updating an existing test case, from the Data Quality Report dashboard, select a test case from one of the rows in the test case results table. At the top right of the Test Case Details page, click the Gear icon and select Edit.
If you are creating a new test case, from the Data Quality Report dashboard, click the + (add) button and select Test Case.
The Test Case page appears with an empty query editor. By default, all entity groups are enabled for the new test case.
To add or update the test case query:
- Type a name and description for the test case.
- Begin typing your SQL code in the text area. While you type, you can press Control-Space to display auto complete options for keywords, tables, fields, and operators. Double-click a selection in the drop-down list to use it in your code.
Note that as you type, an icon appears to the lower left indicating whether your code is valid. See the Validate the query section for information on automatic query validation.
- Click the corresponding links at the bottom of the text area to view valid keywords, tables, fields, reference data, or operators.
View or hide invalid records
The Record State icon at the bottom right of the editor, by default, is set to hide any records with a state of INVALID, DELETED, or MERGED_INTO from the results. You can choose to display these records in your results by clicking the icon. When these record states are unhidden, the Eye icon appears open. You can click the icon again to hide these record states.
Validate the query
As you type your query, an icon appears to the lower left indicating whether or not your code is valid. Note that until you finish complete sections of code, the icon will appear as an x.
Once you have completed a successful section of code, it should appear as a check mark, indicating that the code is valid.
If your code is not validating successfully, you can click the View Errors link next to the x icon to see the errors in your code.
Note that if you leave this option enabled, the error messages will resolve as you fix the code, and re-appear as you type additional code, until the code is complete and valid. You can click the Hide Errors link next to the x icon to hide these messages.
Once you have completed your code and it validates successfully, the green check mark icon will re-appear in the lower left corner.
Configure the failure threshold
Select an option next to Allow Record Failures to define acceptable limits for the test case:
None – This test case will fail if one or more records fails.
Max – The test case will fail if the maximum number of failed records you specify is exceeded. This setting is used when there are a known (fixed) number of exceptions.
Max per group – The test case will fail based on the maximum number of failed records specified for each individual entity group.
Manage entity groups
In the Entity Groups section of the Test Case page, you can select entity groups for the test case.
To enable or disable entity groups for the current test case, click the corresponding checkbox in the ENABLED? column of the table. You can enable or disable all entity groups by clicking the checkbox next to the column heading. You can also filter the list by entity group name.
Ensure that you click Save at the top of the page to save your changes.
To create and add an entity group, at the bottom of the test case list, click the +Add Entity Group link. For more information on creating entity groups, see the Drill down by entity group section.
Reports and report emails are now displayed in a user’s preferred language, for all languages currently supported in Network.
For other languages (as well as those already translated), you can customize or add translations at the bottom of the Test Group page.