Bug 410147 - Autotests fail
Summary: Autotests fail
Status: RESOLVED FIXED
Alias: None
Product: KDE Itinerary
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Volker Krause
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-24 08:06 UTC by Fabian Vogt
Modified: 2019-07-24 17:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Vogt 2019-07-24 08:06:11 UTC
Fails as something in the .model moves:

[   38s] --- /home/abuild/rpmbuild/BUILD/itinerary-0.0.1git.20190723T190031~4645c6d/autotests/data/tripgroupproxy/expand-collapse-r0.model      2019-07-23 17:00:31.000000000 +0000
[   38s] +++ /home/abuild/rpmbuild/BUILD/itinerary-0.0.1git.20190723T190031~4645c6d/autotests/data/tripgroupproxy/expand-collapse-r0.model.fail 2019-07-24 08:01:32.540030817 +0000
[   38s] @@ -957,33 +957,6 @@
[   38s]          "reservations": [
[   38s]              {
[   38s]                  "@context": "http://schema.org",
[   38s] -                "@type": "BusReservation",
[   38s] -                "reservationFor": {
[   38s] -                    "@type": "BusTrip",
[   38s] -                    "arrivalBusStop": {
[   38s] -                        "@type": "BusStation",
[   38s] -                        "name": "Zermatt"
[   38s] -                    },
[   38s] -                    "arrivalTime": "2017-09-13T14:20:00",
[   38s] -                    "busName": "",
[   38s] -                    "busNumber": "Zermatt Taxi",
[   38s] -                    "departureBusStop": {
[   38s] -                        "@type": "BusStation",
[   38s] -                        "name": "Randa"
[   38s] -                    },
[   38s] -                    "departureTime": "2017-09-13T14:00:00"
[   38s] -                }
[   38s] -            }
[   38s] -        ],
[   38s] -        "sectionHeader": "Wednesday, 13 Sep 2017",
[   38s] -        "type": 8
[   38s] -    },
[   38s] -    {
[   38s] -        "isToday": false,
[   38s] -        "rangeType": 0,
[   38s] -        "reservations": [
[   38s] -            {
[   38s] -                "@context": "http://schema.org",
[   38s]                  "@type": "TouristAttractionVisit",
[   38s]                  "arrivalTime": {
[   38s]                      "@type": "QDateTime",
[   38s] @@ -1016,6 +989,33 @@
[   38s]      },
[   38s]      {
[   38s]          "isToday": false,
[   38s] +        "rangeType": 0,
[   38s] +        "reservations": [
[   38s] +            {
[   38s] +                "@context": "http://schema.org",
[   38s] +                "@type": "BusReservation",
[   38s] +                "reservationFor": {
[   38s] +                    "@type": "BusTrip",
[   38s] +                    "arrivalBusStop": {
[   38s] +                        "@type": "BusStation",
[   38s] +                        "name": "Zermatt"
[   38s] +                    },
[   38s] +                    "arrivalTime": "2017-09-13T14:20:00",
[   38s] +                    "busName": "",
[   38s] +                    "busNumber": "Zermatt Taxi",
[   38s] +                    "departureBusStop": {
[   38s] +                        "@type": "BusStation",
[   38s] +                        "name": "Randa"
[   38s] +                    },
[   38s] +                    "departureTime": "2017-09-13T14:00:00"
[   38s] +                }
[   38s] +            }
[   38s] +        ],
[   38s] +        "sectionHeader": "Wednesday, 13 Sep 2017",
[   38s] +        "type": 8
[   38s] +    },
[   38s] +    {
[   38s] +        "isToday": false,
[   38s]          "rangeType": 0,
[   38s]          "reservations": [
[   38s]              {
[   38s] FAIL!  : TripGroupProxyTest::testExpandCollapse() 'vp0.verify(&proxy)' returned FALSE. ()
[   38s]    Loc: [/home/abuild/rpmbuild/BUILD/itinerary-0.0.1git.20190723T190031~4645c6d/autotests/tripgroupproxytest.cpp(95)]

(same for /home/abuild/rpmbuild/BUILD/itinerary-0.0.1git.20190723T190031~4645c6d/autotests/data/tripgroupproxy/current-r0.model)

Fails as network is not allowed inside the build:

[   38s] 10/10 Test #10: weathertest ......................***Failed    0.02 sec
[   38s] ********* Start testing of WeatherTest *********
[   38s] Config: Using QtTest library 5.13.0, Qt 5.13.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 9.1.1 20190703 [gcc-9-branch revision 273008])
[   38s] PASS   : WeatherTest::initTestCase()
[   38s] PASS   : WeatherTest::testParseForecastData()
[   38s] PASS   : WeatherTest::testWeatherSymbol()
[   38s] QDEBUG : WeatherTest::testForecastRetrieval() Next weather update: 8520000
[   38s] QDEBUG : WeatherTest::testForecastRetrieval() 46.1 7.78 461 78
[   38s] QDEBUG : WeatherTest::testForecastRetrieval() QUrl("https://api.met.no/weatherapi/locationforecast/1.9/?lat=46.1&lon=7.8")
[   38s] QWARN  : WeatherTest::testForecastRetrieval() "Host api.met.no not found"
[   38s] QDEBUG : WeatherTest::testForecastRetrieval() QDateTime(Invalid) 3.40282e+38 -3.40282e+38 QFlags<WeatherForecast::SymbolFlag>(None) ""
[   38s] FAIL!  : WeatherTest::testForecastRetrieval() 'fc.isValid()' returned FALSE. ()
[   38s]    Loc: [/home/abuild/rpmbuild/BUILD/itinerary-0.0.1git.20190723T190031~4645c6d/autotests/weathertest.cpp(115)]
[   38s] PASS   : WeatherTest::cleanupTestCase()
[   38s] Totals: 4 passed, 1 failed, 0 skipped, 0 blacklisted, 13ms
[   38s] ********* Finished testing of WeatherTest *********
Comment 1 Volker Krause 2019-07-24 08:15:37 UTC
Thanks! 

The first issue seems to be a test relying on the system timezone, easy to fix (most tests already force a specific timezone to avoid that). Can be reproduced with TZ=GMT for example.

The second one is also clear, we probably should disable the part of the test relying on network access by default.
Comment 2 Volker Krause 2019-07-24 17:16:34 UTC
Git commit 41dcfe5188d676a4f97d154958f22149121a43fc by Volker Krause.
Committed on 24/07/2019 at 17:15.
Pushed by vkrause into branch 'master'.

Make trip group proxy autotest independent of the local timezone

M  +18   -2    autotests/data/tripgroupproxy/current-r0.model
M  +18   -2    autotests/data/tripgroupproxy/current-r1.model
M  +18   -2    autotests/data/tripgroupproxy/expand-collapse-r0.model
M  +18   -2    autotests/data/tripgroupproxy/expand-collapse-r1.model
M  +18   -2    autotests/data/tripgroupproxy/expand-collapse-r2.model
M  +1    -0    autotests/tripgroupproxytest.cpp

https://invent.kde.org/kde/itinerary/commit/41dcfe5188d676a4f97d154958f22149121a43fc
Comment 3 Volker Krause 2019-07-24 17:16:35 UTC
Git commit 5f04175a48bed8fd6e2e2e66204288b33ed9f972 by Volker Krause.
Committed on 24/07/2019 at 17:15.
Pushed by vkrause into branch 'master'.

Skip autotests needing network by default

M  +5    -0    autotests/weathertest.cpp

https://invent.kde.org/kde/itinerary/commit/5f04175a48bed8fd6e2e2e66204288b33ed9f972
Comment 4 Fabian Vogt 2019-07-24 17:24:56 UTC
Confirmed, all green now.

Thanks for the quick fix!