[
https://issues.apache.org/jira/browse/OOZIE-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Purshotam Shah updated OOZIE-2688:
----------------------------------
Attachment: YamlUnit.html
Oozie Yaml doc
> YAML representation of Oozie unit testcase
> ------------------------------------------
>
> Key: OOZIE-2688
> URL: https://issues.apache.org/jira/browse/OOZIE-2688
> Project: Oozie
> Issue Type: Bug
> Reporter: Purshotam Shah
> Assignee: Purshotam Shah
> Attachments: YamlUnit.html
>
>
> Example Of Bundle Test
> {code}
> name: TestBundleDisableCoord
> output_path: ./target/oozieyaml-sourcesjob:
> properties:
> raw_logs_path: "/tmp/test"
> aggregated_logs_path: "/user/test"
> workflowPath: "/testDirPath"
> start: "2010-02-01T10:00Z"
> end: "2012-02-03T23:59Z"
> oozie.bundle.application.path:
> "/tmp/workflow-test/bundle-multiple-coord.xml"
> queueName: "defult"
> coord_path_1: "/tmp/workflow-test/coordinator-test-1.xml"
> coord_path_2: "/tmp/workflow-test/coordinator-test-2.xml"
> jobTracker: !func getJobTrackerUri()
> nameNode: !func getNameNodeUri()
> hdfs:
> touchz:
> - /tmp/test/2010/02/01/09/_SUCCESS
> - /tmp/test/2010/02/01/10/_SUCCESS
> - /tmp/test/2010/02/01/11/_SUCCESS
> - /tmp/test/2010/02/01/12/_SUCCESS
> copyFromLocal:
> - source: bundle-multiple-coord.xml
> destination: "/tmp/workflow-test/bundle-multiple-coord.xml"
> - source: coordinator-test-1.xml
> destination: /tmp/workflow-test/coordinator-test-1.xml
> - source: coordinator-test-2.xml
> skip:
> coordinators:
> - coordinator: coord_1
> validations:
> validate_job:
> sleep: 6000
> status: RUNNING
> coordinators:
> - coordinator: coord_2
> not_status: PREP
> coordinator_actions:
> - coordinator_action : "@2"
> not_status: WAITING
> nominal_time: 2010-02-01T11:00Z
> {code}
> Example of Coordinator test
> {code}
> name: TestCoordinator
> output_path: ./target/oozieyaml-sourcesjob:
> properties:
> raw_logs_path: "/tmp/test"
> aggregated_logs_path: "/user/test"
> workflowPath: "/testDirPath"
> start: "2010-02-01T10:00Z"
> end: "2012-02-03T23:59Z"
> oozie.coord.application.path: "/tmp/workflow-test/coordinator.xml"
> queueName: "defult"
> jobTracker: !func getJobTrackerUri()
> nameNode: !func getNameNodeUri()
> hdfs:
> touchz:
> - /tmp/test/2010/02/01/09/_SUCCESS
> - /tmp/test/2010/02/01/10/_SUCCESS
> - /tmp/test/2010/02/01/11/_SUCCESS
> - /tmp/test/2010/02/01/12/_SUCCESS
> copyFromLocal:
> - source: coordinator-test.xml
> destination: "/tmp/workflow-test/coordinator.xml"
> validations:
> validate_job:
> sleep: 6000
> job_conf:
> - key: queueName
> expected_value: defult
> coordinator_actions:
> - coordinator_action : "@2"
> not_status: WAITING
> nominal_time: 2010-02-01T11:00Z
> Coordinator test with HCat
> name: TestCoordinatorWithHcat
> output_path: ./target/oozieyaml-sourcesjob:
> properties:
> raw_logs_path: "/tmp/test"
> aggregated_logs_path: "/user/test"
> workflowAppUri: "/testDirPath"
> start: "2010-02-01T10:00Z"
> end: "2012-02-03T23:59Z"
> oozie.coord.application.path: "/tmp/workflow-test/coordinator.xml"
> queueName: "defult"
> db: db_test
> table: table_test
> dataOut: dataOut
> jobTracker: !func getJobTrackerUri()
> nameNode: !func getNameNodeUri()
> hcatNode: !func \"hcat://\" + getMetastoreAuthority()
> hdfs:
> mkdir:
> - "/tmp/workflow-test/"
> copyFromLocal:
> - source: coordinator-hcat-test.xml
> destination: "/tmp/workflow-test/coordinator.xml"
> hcat:
> create:
> databases:
> - database: db_test
> tables:
> - table: table_test
> columns: "dt,country"
> partitions:
> - dt=20100201;country=usa
> validations:
> validate_job:
> sleep: 6000
> coordinator_actions:
> - coordinator_action : "@1"
> not_status: WAITING
> nominal_time: 2010-02-01T10:00Z
> {code}
> Example Workflow Test
> {code}
> name: TestWorkflowWithPig
> output_path: ./target/oozieyaml-sources
> copy_dependencies_files_hdfs:
> - /tmp/workflow-test/libjob:
> properties:
> INPUT: "/tmp/input/dummp.txt"
> oozie.wf.application.path: "/tmp/workflow-test/"
> queueName: "defult"
> OUTPUT: "/tmp/output"
> jobTracker: !func getJobTrackerUri()
> nameNode: !func getNameNodeUri()
> hdfs:
> mkdir:
> - "/tmp/workflow-test/"
> touchz:
> - /tmp/input/dummp.txt
> copyFromLocal:
> - source: echo.pig
> destination: "/tmp/workflow-test/echo.pig"
> - source: workflow-test-with-pig.xml
> destination: "/tmp/workflow-test/workflow.xml"
> validations:
> validate_job:
> sleep: 60000
> status: SUCCEEDED
> workflow_actions:
> - workflow_action : pig
> status: OK
> Workflow Test with skip Job submission
> {code}
> {code}
> name: TestWorkflowJobStatus
> output_path: ./target/oozieyaml-sources
> copy_dependencies_files_hdfs:
> - /tmp/workflow-test/libjob:
> properties:
> INPUT: "/tmp/input/dummp.txt"
> oozie.wf.application.path: "/tmp/workflow-test/"
> queueName: "defult"
> OUTPUT: "/tmp/output"
> jobTracker: !func getJobTrackerUri()
> nameNode: !func getNameNodeUri()
> hdfs:
> mkdir:
> - "/tmp/workflow-test/"
> touchz:
> - /tmp/input/dummp.txt
> copyFromLocal:
> - source: echo.pig
> destination: "/tmp/workflow-test/echo.pig"
> - source: workflow-test-with-output.xml
> destination: "/tmp/workflow-test/workflow.xml"
> skip:
> workflow_actions:
> - workflow_action : pig
> skip_job_submission: true
> status: OK
> output:
> - source: /tmp/workflow-test/echo.pig
> destination: "/tmp/workflow-test/dummy.pig"
> - workflow_action : pig_2
> skip_job_submission: true
> status: ERROR
> validations:
> validate_job:
> wait_for_status: KILLED
> workflow_actions:
> - workflow_action : pig
> status: OK
> - workflow_action : pig_1
> status: OK
> - workflow_action : pig_2
> status: ERROR
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)