Esri / military-tools-geoprocessing-toolbox

military-tools-geoprocessing-toolbox is a collection of models, scripts, and tools for use in ArcGIS for Desktop and ArcGIS Pro. This toolbox is one component that is a part of Military Tools.
Apache License 2.0
33 stars 14 forks source link

Convert .tbx tools to .pyt: Distance and Direction #273

Closed lfunkhouser closed 6 years ago

lfunkhouser commented 6 years ago

Task to be done - May 16th 2018


Issue https://github.com/Esri/military-tools-geoprocessing-toolbox/issues/262 has been broken down into toolsets. The Distance and direction tools are:

Acceptance Criteria: Target release: Military Tools 3.0 Pro 2.1 and 2.2 10.3.1+ One toolbox Team works together to understand the tests that are currently running. Tests written and running for tools: Team works together to design additional tests (result expectation). Toolset included in the toolbox in the .zip Tools documented Tools tested User documentation complete and published

lfunkhouser commented 6 years ago

@csmoore completed the dev tasks - comments on progress were captured here, https://github.com/Esri/military-tools-geoprocessing-toolbox/issues/262

ACueva commented 6 years ago

Jenkins Unit tests now run. Staging location for tests: http://dev0002292:8080/job/GP%20Unit%20tests/

Tests are currently running against the master branch. I have also run these tests against the dev branches of the https://github.com/Esri/military-tools-geoprocessing-toolbox repo. Both these branches fail:

Broken Unit tests ArcMap: Master branch http://dev0002292:8080/job/GP%20Unit%20tests/job/ArcMap%20Test%20Runner/7/console Dev Branch http://dev0002292:8080/job/GP%20Unit%20tests/job/ArcMap%20Test%20Runner/5/console

Broken Unit tests ArcGIS Pro: Master branch http://dev0002292:8080/job/GP%20Unit%20tests/job/ArcGIS%20Pro%20Test%20Runner/2/console Dev Branch http://dev0002292:8080/job/GP%20Unit%20tests/job/ArcGIS%20Pro%20Test%20Runner/1/console

FYI @csmoore

csmoore commented 6 years ago

@ACueva - I'm not able to hit the Jenkins console links above (seems to require login) but looks like the master branch is a bit older than I expected (7/2017).

If it helps, I created a branch from the commit that I know I last successfully unit tested in 11/2017 - commit: https://github.com/Esri/military-tools-geoprocessing-toolbox/commit/c86b6ed2c61528ceeeea6535d35804bc7263ead5 - Branch: https://github.com/Esri/military-tools-geoprocessing-toolbox/blob/csm/working-unit-test-branch

ACueva commented 6 years ago

@csmoore re-ran the unit tests off the branch you provided. ArcMap passed successfully - Ran against 10.3.1 ArcGIS Pro 2.1 failed with the following errors:

RESULTS =================================================
Number of tests run: 72
Number succeeded: 70
Number of errors: 0
Number of failures: 2
Number of tests skipped: 0
Percent passing: 97.2
=========================================================

ERROR: 2018-05-07 08:15:04,719 FAILURES ================================================
ERROR: 2018-05-07 08:15:04,719 test_table_to_lineofbearing (conversion_tests.TableToLineOfBearingTestCase.TableToLineOfBearingTestCase)
ERROR: 2018-05-07 08:15:04,719 Traceback (most recent call last):
ERROR: 2018-05-07 08:15:04,720   File "c:\jDev\workspace\GP Unit tests\ArcGIS Pro Test Runner\military-tools-geoprocessing-toolbox\utils\test\conversion_tests\TableToLineOfBearingTestCase.py", line 105, in test_table_to_lineofbearing
ERROR: 2018-05-07 08:15:04,720     "OID", 0.0001, ['Shape_Length'])
ERROR: 2018-05-07 08:15:04,720   File "c:\jDev\workspace\GP Unit tests\ArcGIS Pro Test Runner\military-tools-geoprocessing-toolbox\utils\test\arcpyAssert.py", line 123, in assertFeatureClassEqualSimple
ERROR: 2018-05-07 08:15:04,720     None, None, None, omit_field)
ERROR: 2018-05-07 08:15:04,720   File "c:\jDev\workspace\GP Unit tests\ArcGIS Pro Test Runner\military-tools-geoprocessing-toolbox\utils\test\arcpyAssert.py", line 111, in assertFeatureClassEqual
ERROR: 2018-05-07 08:15:04,720     raise AssertionError(msg)
ERROR: 2018-05-07 08:15:04,721 AssertionError: Feature class c:\jDev\workspace\GP Unit tests\ArcGIS Pro Test Runner\military-tools-geoprocessing-toolbox\utils\test\scratch.gdb\outputLines is not equal to c:\jDev\workspace\GP Unit tests\ArcGIS Pro Test Runner\military-tools-geoprocessing-toolbox\testdata\Results.gdb\ExpectedOutputTableToLOB
ERROR: 2018-05-07 08:15:04,721 test_table_to_point (conversion_tests.TableToPointTestCase.TableToPointTestCase)
ERROR: 2018-05-07 08:15:04,721 Traceback (most recent call last):
ERROR: 2018-05-07 08:15:04,721   File "c:\jDev\workspace\GP Unit tests\ArcGIS Pro Test Runner\military-tools-geoprocessing-toolbox\utils\test\conversion_tests\TableToPointTestCase.py", line 104, in test_table_to_point
ERROR: 2018-05-07 08:15:04,721     "OID", 0.0001)
ERROR: 2018-05-07 08:15:04,721   File "c:\jDev\workspace\GP Unit tests\ArcGIS Pro Test Runner\military-tools-geoprocessing-toolbox\utils\test\arcpyAssert.py", line 123, in assertFeatureClassEqualSimple
ERROR: 2018-05-07 08:15:04,722     None, None, None, omit_field)
ERROR: 2018-05-07 08:15:04,722   File "c:\jDev\workspace\GP Unit tests\ArcGIS Pro Test Runner\military-tools-geoprocessing-toolbox\utils\test\arcpyAssert.py", line 111, in assertFeatureClassEqual
ERROR: 2018-05-07 08:15:04,722     raise AssertionError(msg)
ERROR: 2018-05-07 08:15:04,722 AssertionError: Feature class c:\jDev\workspace\GP Unit tests\ArcGIS Pro Test Runner\military-tools-geoprocessing-toolbox\utils\test\scratch.gdb\outputTableToPoint is not equal to c:\jDev\workspace\GP Unit tests\ArcGIS Pro Test Runner\military-tools-geoprocessing-toolbox\testdata\Results.gdb\ExpectedOutputTableToPoint
INFO: 2018-05-07 08:15:04,722 END OF TEST =========================================
'One or more tests failed'
Press any key to continue . . . 
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
BobBooth commented 6 years ago

Tool help migrated to the PYT tools in this PR: https://github.com/Esri/military-tools-geoprocessing-toolbox/pull/281

BobBooth commented 6 years ago

Updated What's New and Military Tools home page in GitHub to indicate conversion to PYT format, in PR https://github.com/ArcGIS/arcgis-solutions-website/pull/6431

ACueva commented 6 years ago

Verified TestRunner.py imports and runs Distance and Direction test suite: http://dev0002292:8080/job/GP%20Unit%20tests/job/ArcMap%20Test%20Runner/14/console

csmoore commented 6 years ago

@ACueva - I'm not able to reproduce the unit test error above with my Pro 2.1 and the latest test suite - we may need to debug on that machine if the problem persists.

INFO: 2018-05-09 09:28:50,823 ------------ Begin Tests ------------------
INFO: 2018-05-09 09:28:50,837 Platform: Windows-10-10.0.16299-SP0
INFO: 2018-05-09 09:28:50,837 Python Version 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 12:30:02) [MSC v.1900 64 bit (AMD64)]
INFO: 2018-05-09 09:28:50,840 Product: ArcGISPro, Version: 2.1, Installed on: 1/8/2018, Build: 10257.
INFO: 2018-05-09 09:28:50,840 -------------------------------------------

...

INFO: 2018-05-09 09:46:42,438 Test success: True
INFO: 2018-05-09 09:46:42,439
RESULTS =================================================
Number of tests run: 86
Number succeeded: 86
Number of errors: 0
Number of failures: 0
Number of tests skipped: 0
Percent passing: 100.0
=========================================================
ACueva commented 6 years ago

Issue with Pro 2.1 toolbox failing was a result of the branch being used. Changed all unit tests to run against the Dev branch of the Esri/MTGPToolbox repo.

INFO: 2018-05-10 14:02:34,560 
RESULTS =================================================
Number of tests run: 86
Number succeeded: 86
Number of errors: 0
Number of failures: 0
Number of tests skipped: 0
Percent passing: 100.0
=========================================================

INFO: 2018-05-10 14:02:34,561 END OF TEST =========================================
ACueva commented 6 years ago

GP checklist created. Ready for review. https://github.com/ArcGIS/solutions-defense-test-catalog/pull/133 FYI @BobBooth @dfoll @topowright

dfoll commented 6 years ago

Removing G-Doc (CMS) verified what is the the .pyt for Distance and Direction matches what is in the Distance and Direction toolset documentation

dfoll commented 6 years ago

Removing G - QC Checklist (Verify) .... verified the checklist exists, and verified that the tools pass the steps in the checklist. No other labels remain, so I am moving this to done

ACueva commented 6 years ago

Changes made to Checklist test per https://github.com/ArcGIS/solutions-defense-test-catalog/pull/133

csmoore commented 6 years ago

The FeatureSet inputs are definitely broken for these 3 tools in the pyt: the problem is with the input schema layer: toolboxes\layers\RangeRingInputObserversGDB.lyr - this layer needs to be recreated. @BobBooth and I learned as part of this process that only the Save-To-Layer GP tool creates the layer with the necessary relative paths to make the lyr file portable (lyrs that point to a live GDB is a new requirement of the pyt)