After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 741784 - lua-factory: testing
lua-factory: testing
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
unspecified
Other All
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2014-12-19 19:56 UTC by Victor Toso
Modified: 2015-08-25 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: enable local tests with lua-factory (911 bytes, patch)
2014-12-19 19:56 UTC, Victor Toso
committed Details | Review
tests: grl-metrolyrics (lua source) (19.53 KB, patch)
2014-12-19 19:56 UTC, Victor Toso
none Details | Review
tests: grl-metrolyrics (lua source) (22.82 KB, patch)
2015-03-04 18:26 UTC, Victor Toso
committed Details | Review
lua-factory: fix change in metrolyrics (website) (1.87 KB, patch)
2015-03-04 18:26 UTC, Victor Toso
committed Details | Review
lua-factory: Fix makefile rule to euronews resource (1.00 KB, patch)
2015-03-04 18:26 UTC, Victor Toso
committed Details | Review

Description Victor Toso 2014-12-19 19:56:43 UTC
Important tests related to lua-factory are:
- tests for lua sources;
- tests for lua-library;

I'm starting with the simplest part, enabling tests for the a lua source and
a tests for metrolyrics plugin;

I'm not sure yet what is the best approach for testing lua-library, atm I would like to:
1-) Create a lua module from lua-library
2-) Lua scripts using the module above to tests de functions
3-) Evaluate the results of lua scripts the same way that we do in other sources (g_test_run)

Issues:
- Some functions use lua-factory structure (OperationSpec *) to deal with async operations
like grl.fetch
- (probably more)

After having proper tests, documentation would be the next step :-)
Comment 1 Victor Toso 2014-12-19 19:56:47 UTC
Created attachment 293091 [details] [review]
tests: enable local tests with lua-factory
Comment 2 Victor Toso 2014-12-19 19:56:52 UTC
Created attachment 293092 [details] [review]
tests: grl-metrolyrics (lua source)
Comment 3 Victor Toso 2014-12-19 20:35:56 UTC
> I'm not sure yet what is the best approach for testing lua-library, atm I would
> like to:
> 1-) Create a lua module from lua-library
> 2-) Lua scripts using the module above to tests de functions
> 3-) Evaluate the results of lua scripts the same way that we do in other
> sources (g_test_run)
> 
> Issues:
> - Some functions use lua-factory structure (OperationSpec *) to deal with async
> operations
> like grl.fetch
> - (probably more)

Actually, having a fake-lua-source for test looks much better and simpler...
Comment 4 Bastien Nocera 2015-01-05 23:43:05 UTC
Review of attachment 293091 [details] [review]:

Sure.
Comment 5 Bastien Nocera 2015-01-05 23:46:27 UTC
Review of attachment 293092 [details] [review]:

The rest looks good enough though.

::: tests/lua-factory/sources/test_lua_metrolyrics.c
@@ +26,3 @@
+#define METROLYRICS_OPS GRL_OP_RESOLVE
+
+#define LYRICS_RING_OF_FIRE \

The lyrics definitely need to be in a separate file, one for each song, that we'd either load from disk, or use GResources to embed.
Comment 6 Bastien Nocera 2015-02-17 17:14:45 UTC
Comment on attachment 293091 [details] [review]
tests: enable local tests with lua-factory

Attachment 293091 [details] pushed as cc55425 - tests: enable local tests with lua-factory
Comment 7 Victor Toso 2015-03-04 18:26:14 UTC
Created attachment 298564 [details] [review]
tests: grl-metrolyrics (lua source)

* Split lyrics in several files and use GResource;
Comment 8 Victor Toso 2015-03-04 18:26:28 UTC
Created attachment 298565 [details] [review]
lua-factory: fix change in metrolyrics (website)

HTML part of the lyrics changed. I've changed the get_lyrics to clean up
HTML that cames with the lyrics instead of matching it.
Comment 9 Victor Toso 2015-03-04 18:26:37 UTC
Created attachment 298566 [details] [review]
lua-factory: Fix makefile rule to euronews resource

The rule to make euronews GResource uses guardianvideos's resource
description as dependency.
Comment 10 Victor Toso 2015-03-04 18:35:30 UTC
PS: I still want to do lua-library tests with a 'fake' lua source as per #c3
Comment 11 Bastien Nocera 2015-03-05 09:59:17 UTC
Review of attachment 298564 [details] [review]:

Apart from that, looks good.

::: tests/lua-factory/sources/test_lua_metrolyrics.c
@@ +96,3 @@
+    g_assert_no_error (error);
+
+    data = g_bytes_get_data (bytes, &size);

GFile *file = g_file_new_for_uri ("resources:///org/gnome/grilo/plugins/test/metrolyrics/data/foo.txt");
g_file_load_contents(file, ...);

Simpler.
Comment 12 Bastien Nocera 2015-03-05 10:02:10 UTC
Review of attachment 298565 [details] [review]:

> lua-factory: fix change in metrolyrics (website)

Update for change in metrolyrics website

> HTML part of the lyrics changed. I've changed the get_lyrics to clean up
> HTML that cames with the lyrics instead of matching it.

"came" (there's no 's' at the third-person singular in preterit)
Comment 13 Bastien Nocera 2015-03-05 10:02:32 UTC
Review of attachment 298566 [details] [review]:

Yes.
Comment 14 Victor Toso 2015-03-05 18:15:47 UTC
pushed as a8a419d112e234d3fe8c7e843b0ab0f64c191cbf

Keeping the bug open for the lua-library tests
Comment 15 Victor Toso 2015-08-25 16:08:45 UTC
Review of attachment 298565 [details] [review]:

This was commited as 31f4af07be38e2a66112adda35b99360507d2397
Comment 16 Victor Toso 2015-08-25 16:09:59 UTC
Review of attachment 298564 [details] [review]:

This was commited as a8a419d112e234d3fe8c7e843b0ab0f64c191cbf