Smoke testing

更新时间:
复制 MD 格式

After you develop the code for a node, you can run a smoke test to debug it. This topic describes how to run smoke testing in the development environment.

Overview

Before you publish a node, we strongly recommend using smoke testing to verify its configuration and operational logic. Smoke testing primarily validates the following:

  • Whether scheduling parameters are correctly substituted.

  • Whether upstream and downstream dependencies are configured correctly.

  • Whether the node execution produces the expected results.

In a standard workspace, smoke testing runs in an isolated development environment. Even if a task involves writing data, your production data remains unaffected.

Go to Data Development

Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose Data Development and O&M > Data Development. On the page that appears, select the desired workspace from the drop-down list and click Go to Data Development.

Enable mandatory smoke testing

Workspace administrators can enable mandatory smoke testing. After this feature is enabled, all tasks in the current workspace must pass smoke testing before you can publish them to the production environment.

Note

Workspaces in basic mode do not support mandatory smoke testing.

  1. In the left-side navigation pane of Data Development, click the 设置 icon to go to the Settings page.

  2. On the Settings page, choose Security Settings and Others > Test and enable mandatory smoke testing for the workspace.

Run a smoke test

After developing the code, you can start a smoke test in one of the following ways before publishing the task for production scheduling:

  • When you commit a node, click the 提交按钮 icon on the toolbar of the node editor in DataStudio, and then select Yes for the Test option.

  • After you commit a node, click the 冒烟测试 icon on the toolbar of the node editor in DataStudio to run a smoke test.

  • After you commit a node, go to the Task Publishing page and click the Test button for the node.

  • On the Operation Center page, switch to the Operation Center for the development environment in the upper-left corner. In the left-side navigation pane, click Auto Triggered Task O&M > Periodic tasks. Then, right-click the target node and click Test.

Configure smoke testing parameters

After you start a smoke test, you must select a data timestamp for the test run.

Note

If you select today or yesterday as the business date for a smoke test, the smoke testing task will wait until its scheduled time to run. For example, if the current time is 2024-06-02 12:00, the scheduled run time of the task is 15:00, and the business date for the test is 2024-06-01, the actual run time of the task will be 2024-06-02 15:00. In this case, the smoke testing task enters a waiting period because the scheduled time of 15:00 has not yet been reached.

View smoke testing records

  1. On the node editor toolbar in DataStudio, click the 查看冒烟测试按钮 icon to go to the View Log of Smoke Testing in Development Environment page.

    Note
    • If you select Yes for the Test option when you commit a node, you can view the smoke test record by using this method after the commit.

    • After you click the Test button on the node editing page, you can view the smoke test records in the dialog box that appears after parameter configuration.

    • If this entry is missing from the left-side navigation pane of Data Development, you can add the module on the Settings page. For more information, see Change the layout: Customize the displayed modules.

  2. On the Smoke Testing Records page, you can view details such as Tested At, Version, Tested By, and Business Date. Click Initiated in DataStudio to quickly locate the smoke testing records triggered from the DataStudio interface.

    Note

    Filtering for records initiated in DataStudio excludes test records run from the Operation Center for the development environment.

  3. On this page, you can click View Log to check the execution log for a specific smoke test. For a record with a Status of Running, you can click the Stop button to terminate the run.