Merge lp:~morphis/aethercast/fix-integraion-tests into lp:aethercast

Proposed by Simon Fels
Status: Merged
Approved by: Simon Fels
Approved revision: 152
Merged at revision: 149
Proposed branch: lp:~morphis/aethercast/fix-integraion-tests
Merge into: lp:aethercast
Diff against target: 52 lines (+11/-2)
1 file modified
tests/ac/integration_tests/test_stream_performance.cpp (+11/-2)
To merge this branch: bzr merge lp:~morphis/aethercast/fix-integraion-tests
Reviewer Review Type Date Requested Status
Matteo Croce (community) Approve
Konrad Zapałowicz (community) code Approve
Review via email: mp+298400@code.launchpad.net

Commit message

Fix integration tests

There were several problems with the integration tests so that they couldn't run at all. This fixes the different problems:

* don't acquire display lock twice
* allow user to specify a different reference result file per environment variable
* run glib mainloop for a second on startup to respect deferred pipeline startup

To post a comment you must log in.
152. By Simon Fels

tests: integration: finish started comment

Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

LGTM except on the missing comment line.

review: Needs Fixing (code)
Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

LGTM

review: Approve (code)
Revision history for this message
Matteo Croce (teknoraver) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/ac/integration_tests/test_stream_performance.cpp'
2--- tests/ac/integration_tests/test_stream_performance.cpp 2016-05-31 13:43:18 +0000
3+++ tests/ac/integration_tests/test_stream_performance.cpp 2016-06-27 08:59:28 +0000
4@@ -32,6 +32,8 @@
5 #include <boost/accumulators/statistics/stats.hpp>
6 #include <boost/accumulators/statistics/variance.hpp>
7
8+#include <boost/filesystem.hpp>
9+
10 #include "ac/mediamanagerfactory.h"
11 #include "ac/networkutils.h"
12 #include "ac/utils.h"
13@@ -41,10 +43,12 @@
14
15 #include "tests/common/benchmark.h"
16 #include "tests/common/statistics.h"
17+#include "tests/common/glibhelpers.h"
18
19 #include "tests/ac/integration_tests/config.h"
20
21 namespace ba = boost::accumulators;
22+namespace fs = boost::filesystem;
23
24 using namespace ::testing;
25
26@@ -157,11 +161,14 @@
27 media_manager->InitOptimalVideoFormat(sink_native_format, sink_codecs);
28 media_manager->Play();
29
30+ // Need to run glib mainloop for a bit to respect deferred pipeline startup
31+ ac::testing::RunMainLoop(std::chrono::seconds{1});
32+
33 std::this_thread::sleep_for(config.duration);
34
35 media_manager->Teardown();
36
37- system_controller->DisplayStateLock()->Acquire(ac::DisplayState::Off);
38+ system_controller->DisplayStateLock()->Release(ac::DisplayState::Off);
39
40 FillResultsFromStatistics(benchmark_result, stats);
41 return benchmark_result;
42@@ -172,7 +179,9 @@
43 TEST(StreamPerformance, EndToEndIsAcceptable) {
44 ac::testing::Benchmark::Result reference_result;
45
46- std::ifstream in{ac::testing::stream_performance::kReferenceResultFile};
47+ auto ref_path = ac::Utils::GetEnvValue("AETHERCAST_TESTS_REFERENCE_RESULTS",
48+ ac::testing::stream_performance::kReferenceResultFile);
49+ std::ifstream in{ref_path};
50 reference_result.load_from_xml(in);
51
52 StreamBenchmark benchmark;

Subscribers

People subscribed via source and target branches

to all changes: