69 Commits

Author SHA1 Message Date
Nyall Dawson
9968962ab9 Allow specifying multiple possible vector layer results for processing
tests

Some algorithms are non-deterministic and the results may vary from
run to run. In this case we allow specifying multiple possible valid
results, and the test will pass if the result layer matches any of these.
2017-08-05 17:51:38 +10:00
Nyall Dawson
5d635d190d Allow list of acceptable raster hashes for processing algorithm tests
Differences in gdal libraries mean the hash value may differ between
platforms. Allow multiple acceptable hashes to be listed for
expected test results
2017-08-05 17:51:38 +10:00
Nyall Dawson
504cc1f390 Port Truncate alg to new API 2017-07-27 14:43:42 +10:00
Alexander Bruy
56208540f9 [processing] remove GeoAlgorithmExecutionException 2017-07-13 09:02:24 +03:00
Nyall Dawson
1e13d733c2 Move declaration of algorithm parameters/outputs to a new virtual
initAlgorithm() method

This allows 2 benefits:
- algorithms can be subclassed and have subclasses add additional
parameters/outputs to the algorithm. With the previous approach
of declaring parameters/outputs in the constructor, it's not
possible to call virtual methods to add additional parameters/
outputs (since you can't call virtual methods from a constructor).

- initAlgorithm takes a variant map argument, allowing the algorithm
to dynamically adjust its declared parameters and outputs according
to this configuration map. This potentially allows model algorithms which
can be configured to have variable numbers of parameters and
outputs at run time. E.g. a "router" algorithm which directs
features to one of any number of output sinks depending on some
user configured criteria.
2017-07-10 16:31:14 +10:00
Nyall Dawson
05364aa5f0 When running algorithm tests, if two parameters share the same
layer source, ensure that the actual parameter values point
to the same layer
2017-07-07 09:28:19 +10:00
Nyall Dawson
ab06973d6a Don't try to load default styles in processing test layers 2017-07-07 09:28:19 +10:00
Nyall Dawson
8a84e134cc Algorithms don't have to be split to prepare/process/postProcess
Since it's safe to evaluate parameters in background threads
now, it's usually going to be ok to evaluate everything in
the processAlgorithm step.

This keeps the algorithm code as simple as possible, and will
make porting faster.

Note that the prepare/postProcess virtual methods still exist
and can be used when an algorithm MUST do setup/cleanup work
in the main thread.
2017-07-07 09:28:19 +10:00
Nyall Dawson
274d684f64 Fix procesing test layer loading 2017-07-07 09:28:19 +10:00
Nyall Dawson
b917a82662 Better debuging from processing alg tests 2017-07-07 09:28:19 +10:00
Nyall Dawson
d2b9652d4b Fix use of direct map layers as inputs for source parameters 2017-06-29 08:00:47 +10:00
Nyall Dawson
c3e24b76b5 Fix some processing tests where output is not generated or should
not be compared
2017-06-23 12:48:58 +10:00
Nyall Dawson
93b7c2809e Report success or failure after running algs
And auto catch python exceptions and report failure of model
2017-06-23 12:08:54 +10:00
Nyall Dawson
ce42d6c41b Reduce noise in algorithm tests 2017-06-22 05:16:01 +10:00
Nyall Dawson
bdf051a03a Partially port a trial python alg to new API 2017-06-06 07:41:19 +10:00
Nyall Dawson
0c3ad14c79 Adapt more python code to new API 2017-06-06 07:41:19 +10:00
Nyall Dawson
4cb7d18b1c Push parameters into processAlgorithm and related functions 2017-06-06 07:41:19 +10:00
Nyall Dawson
2da85f8771 Temporarily deactivate all processing providers/algorithms
While the processing API is in such a state of flux it's
become unmaintainable to port these algorithms change-by-change.
Instead, disable them all until the API is fixed, and then we
can port them algorithm by algorithm and reactivate each
test in turn.
2017-06-06 07:41:19 +10:00
Alexander Bruy
429e67e0f9 [processing] remove stuff related to R provider 2017-05-02 12:39:26 +03:00
Nyall Dawson
91679b3cbd [processing] Don't use config values for invalid geometry handling in tests 2017-04-26 12:53:35 +10:00
Nyall Dawson
5a6f11d52e Some cleanups 2017-04-07 13:21:28 +10:00
Nyall Dawson
4970bb4cd5 Move more algList functionality to QgsProcessingRegistry 2017-04-07 13:21:28 +10:00
Alexander Bruy
394b4f1a87 fix typo 2017-03-16 17:48:39 +02:00
Alexander Bruy
c603df1aa8 [processing] allow tests for scripts 2017-03-16 17:48:39 +02:00
Juergen E. Fischer
c77172ed3d fix more flake8 warnings 2017-03-05 10:21:24 +01:00
Alexander Bruy
5939ae23e7 Merge pull request #4076 from volaya/remove_processing_providers
[FEATURE][processing] removed otb and lidartools providers

Tagged as feature to not forget mention this in changelog and docs
2017-02-02 10:56:56 +02:00
Nyall Dawson
79bf17ae1f Replace deprecated assertRegexpMatches call 2017-01-31 07:18:11 +10:00
volaya
f94f0d753c [processing] removed otb tests 2017-01-30 11:59:49 +01:00
Alexander Bruy
80d0d05b18 [FEATURE][processing] remove TauDEM provider from core Processing
TauDEM is quite specific set of tools and it requires installation of
some additional tools. So we decide to turn it into separate provider,
reducing core codebase size and maintenance efforts.

Tagged as feature to not forget mention in changelog and documentation
2017-01-11 15:15:37 +02:00
Nyall Dawson
7a7f11980e [processing] Allow tests for algs which modify layers in place
Add test for Create Attribute Index algorithm
2017-01-06 08:54:04 +10:00
Alexander Bruy
ce9c08f3f6 [processing] rename GdalOgr provider to Gdal provider
Show version numbers in providers descriptions
2016-12-31 09:09:07 +02:00
Alexander Bruy
ea4f05d931 [processing] add support for custom parameter used in interpolation algs
to the test suite
2016-12-20 14:29:51 +02:00
Alexander Bruy
ed0e39e08b [processing] also remove GRASS 6 from tests 2016-12-13 15:55:30 +02:00
Martin Dobias
d56a97d4fe Merge QgsMapLayerRegistry into QgsProject
All methods/signals of QgsMapLayerRegistry moved verbatim to QgsProject.
2016-12-10 15:18:12 +08:00
Nyall Dawson
69e8e4a3c2 [processing] Allow alg tests to use ParameterTable inputs 2016-11-24 07:52:17 +10:00
Alexander Bruy
af16bbf532 [processing] don't print Processing version 2016-11-12 13:31:45 +02:00
Alexander Bruy
2c9fdae414 move imports to the top 2016-10-10 15:56:00 +03:00
Alexander Bruy
9b75746003 [processing] remove obsolete import 2016-10-07 16:32:15 +02:00
Juergen E. Fischer
31df84aa6b run 2to3 on source 2016-09-21 23:30:04 +02:00
Matthias Kuhn
bb79d13e82 Remove deprecated Qgis::WKBType and API cleanup (#3325)
* Remove deprecated Qgis::WKBType and API cleanup

Renames QgsWKBTypes to QgsWkbTypes

Replaces usage of the enums:

* Qgis::WKBType with QgsWkbTypes::Type
* Qgis::GeometryType with QgsWkbTypes::GeometryType

Their values should be forward compatible (a fact that was already
explited up to now by casting between the types)

Renames some SSLxxx to SslXxx and URIxxx to UriXxx

* Fix build warnings and simplify type handling

* Add a fixer to rewrite imports

* The forgotten rebase conflictThe forgotten rebase conflicts

* QgsDataSourcURI > QgsDataSourceUri

* QgsWKBTypes > QgsWkbTypes

* Qgis.WKBGeom > QgsWkbTypes.Geom

* Further python fixes

* Guess what... Qgis::wkbDimensions != QgsWkbTypes::wkbDimensions

* Fix tests

* Python 3 updates

* [travis] pull request caching cannot be disabled

so at least use it in r/w mode

* Fix python3 print in plugins
2016-08-04 09:10:08 +02:00
Médéric RIBREUX
8d1bec33a0 Exec things... 2016-05-29 09:00:16 +02:00
Médéric RIBREUX
ec6b29aa8c Remove NaN values from raster before hash calculation 2016-05-29 09:00:16 +02:00
Médéric Ribreux
235f986517 Fix qt5 travis build and update README for Processing tests 2016-05-29 09:00:16 +02:00
Médéric Ribreux
c867123f18 Fix exec statement for AlgorithmsTestBase.py
On travis-ci environment, Python version seems to be affected by [this bug](https://bugs.python.org/issue21591).
One way to fix it is to use the old statement instead of exec() function.
2016-05-29 09:00:16 +02:00
Médéric Ribreux
1945facd1d Temporary make Grass7Utils more verbose for more travis debug 2016-05-29 09:00:16 +02:00
Médéric Ribreux
8884cd715a Add ugly debug prints to try to find what is travis-ci problem... 2016-05-29 09:00:16 +02:00
Médéric Ribreux
03a8a8e507 Try without subfunction 2016-05-29 09:00:16 +02:00
Médéric Ribreux
cd7047cc7c Try this exec modification 2016-05-29 09:00:16 +02:00
Médéric Ribreux
1f21af6672 Improve tests: add external file support into AlgorithmsTest 2016-05-29 09:00:16 +02:00
Médéric Ribreux
e70f9bcf0c Add first set of unit tests 2016-05-29 09:00:16 +02:00