Opened 8 years ago

Last modified 4 years ago

#1268 new defect/bug

Figure out a way to setup functional testing for generated routes.

Reported by: kazer Owned by: KaZeR
Priority: minor Milestone: version 0.6.0
Component: tools Version: git master
Severity: normal Keywords:
Cc:, (2)

Description (last modified by kazer)

I've been thinking of building a list of small segments where we know we have had issues in the past, to ensure that we can do some functional testing using for example the gpx output. We can then be notified if a change in the routing or navigation has an impact on the generated route ( wether intended or not ).

We have added the possibility to export a generated route as GPX via DBUS, so checking for regressions / improvements is easily scriptable now, as we just need to diff two files.

Any thoughts welcome on this topic. I think we could maybe start a list somewhere as long as it is easily downloadable by a script so that it can be replayed. We *could* use a file in the code for that, but I'd like users to be able to participate without requiring write access to the repo, or having a dev needing to commit it for them. A wiki page maybe ? I was also thinking of a github repo with automatic commit of the gpx so we can analyze the history of these routes.

The point is that it should be easy for everyone to contribute. People reporting routing issues in trac should also be able to add an example.

Change History (11)

comment:1 Changed 8 years ago by kazer

  • Description modified (diff)

comment:2 Changed 8 years ago by kazer

  • Description modified (diff)

comment:3 Changed 8 years ago by mvglasow (2)

  • Cc (2) added

How would you run these tests?

  • as a test suite after each build on the server (and then compare against output of previous build to see if any routes have changed)?
  • on (user's) demand?

In the first case we might want to keep the test cases to a set of representative ones, thus I'd prefer have a dev look over any new tests that come in and either reject duplicates or replace old test cases with newer ones.

In the second case we can have a somewhat more open interface. Maybe a web form into which users enter their starting point and destination, and then compare results? (Just realized that in this case we'd basically be providing a route planning service...)

We also need to consider map updates. On one hand, we need somewhat up-to-date map data (else users will come to us with test cases involving roads that aren't in the map data we use). On the other hand, map updates can also change routing, thus updating too frequently defeats the purpose of being able to compare. In the case of a post-build test suite, we would need to update the baseline data after each map update.

I really like the visualization you posted in #660 – how did you visualize the GPX file?

comment:4 Changed 8 years ago by kazer

Thanks for you insights.

My first idea was to use a service such as cloudbees or ( which I really like, but unfortunately does not support SVN, even if we can easily figure out a way around this) to do CI. Our servers are already quite busy with the map processing, and both cloudbees and are free for FLOSS projects. Plus it would be a service that we don't need to maintain ourself.

Your point of reviewing the tests case to ensure they are representative is valid. Providing a route planning service could be interesting too, especially since it could be cheap (in terms of development) to setup.

About map updates, we could have an optional map version tag attached to a set of coordinates. Since each item in a map is usually around 2MB, your question lead me to wonder if we could put maps in a Github repo as flat files instead of zip and then we could be able to fetch a map at a given point in time. Only question then is the maximal size of a repo.

The test route was generated using, but I'm almost done setting up a similar service for our own needs using] with a GPX extension.

comment:5 Changed 8 years ago by kazer

I did some tests, and here is an example of what we can achieve quite easily : geojson file stored in Github

Modifying the gpx export function to export also geojson should be trivial. Users could then submit the files to web ui, doing some basic validation ( ensuring that the file is indeed a valid geojson) and then we could push the files into a repository automatically (would be useful for bug reports).

We can also generate these files for the CI part. The benefit over GPX is that Github will render the map directly using leaflet and that the maps are browsable, with the announcement displayed when you click on a marker.

Last edited 8 years ago by kazer (previous) (diff)

comment:6 Changed 8 years ago by mvglasow (2)

In the meantime, I have built a simple test suite consisting of a bash script and a text file. It can be found at ​

While testing announcements I was made aware that the icon displayed by the nav_next_turn OSD and the verbal instruction are generated separately. We should therefore include both in the GPX file; the icon name could go into <type>. I'm currently working on that.

comment:7 Changed 8 years ago by mvglasow (2)

<type> is implemented in r5938.

comment:8 Changed 8 years ago by kazer

I have made some progress on this topic.

I've imported mvglasow's tests and wrote a simple python script that runs each test case and produce a junit-compatible report.

The code : Example result :

Example test case :

# Tests for missing or unnecessary announcements
# Ammerseestr
  lat: 48.1217347
  lng: 11.5026473
  lat: 48.1237784
  lng: 11.484457

    source: 'dbus'
    item: 'status'
    value: 33
    operator: '=='

We will need to expand the success criterion, and maybe also specify a map or bbox for each test. Currently we can test for a dbus call result, or perform an xpath query on a gpx export.

comment:9 Changed 7 years ago by kazer

  • Milestone changed from To be discussed - Give your opinion! to version 0.5.1

comment:10 Changed 5 years ago by

  • Milestone changed from version 0.5.1 to version 0.5.2

This ticket was pushed back in order to bring 0.5.1 out soon.

comment:11 Changed 4 years ago by

  • Milestone changed from version 0.5.2 to version 0.6.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.