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 695177 - server/tests are broken in git master
server/tests are broken in git master
Status: RESOLVED FIXED
Product: evolution-ews
Classification: Other
Component: Miscellaneous / EWS Core
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: Evolution EWS maintainer(s)
Evolution EWS maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-03-05 02:21 UTC by Fabiano Fidêncio
Modified: 2013-03-13 10:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
server/tests: fix arguments passed e_ews_connection_create_folder (893 bytes, patch)
2013-03-05 02:24 UTC, Fabiano Fidêncio
accepted-commit_now Details | Review
server/tests: fix typo: get_delegate -> info (914 bytes, patch)
2013-03-05 02:24 UTC, Fabiano Fidêncio
accepted-commit_now Details | Review
server/tests: drop deprecated g_thread_init call (768 bytes, patch)
2013-03-05 02:24 UTC, Fabiano Fidêncio
accepted-commit_now Details | Review
server/tests: use EEwsOofSettings instead of OOFSettings (7.27 KB, patch)
2013-03-05 02:24 UTC, Fabiano Fidêncio
accepted-commit_now Details | Review
Bug #695177 - server/tests: fix make check (13.79 KB, patch)
2013-03-10 17:05 UTC, Fabiano Fidêncio
reviewed Details | Review
Bug #695177 - server/tests: fix make check (22.62 KB, patch)
2013-03-12 14:48 UTC, Fabiano Fidêncio
accepted-commit_now Details | Review

Description Fabiano Fidêncio 2013-03-05 02:21:39 UTC
server/tests were not building in git master. So, I did this patch series (to be uploaded), fixing the build problem. However, trying to run a "make check" looks like the tests are broken themselves[0]. To run the tests, I did:
- set EWS_TEST_USERNAME as a valid username
- set EWS_TEST_PASSWORD as a valid password
- set EWS_TEST_EMAIL as a valid exchange email address
- set EWS_TEST_URI as the URL for a valid exchange email server.

[0]:
fidencio@srv ~/src/gnome/evolution-ews/src/server/tests $ make check
make  testews
make[1]: Entering directory `/home/fidencio/src/gnome/evolution-ews/src/server/tests'
make[1]: `testews' is up to date.
make[1]: Leaving directory `/home/fidencio/src/gnome/evolution-ews/src/server/tests'
make  check-TESTS
make[1]: Entering directory `/home/fidencio/src/gnome/evolution-ews/src/server/tests'
/libews/connections: Test Connections
Success : Created a new connection
Testing Autodiscovery.... 
test-connection.c:128 con_test_autodiscover : password : xxx xxx
test-connection.c:129 con_test_autodiscover : email : foo@bar.boo
Testing postive case... 
 
/bin/sh: line 5: 22369 Segmentation fault      (core dumped) ${dir}$tst
FAIL: testews
===========================================================================
1 of 1 test failed
Please report to http://bugzilla.gnome.org/browse.cgi?product=evolution-ews
===========================================================================
make[1]: *** [check-TESTS] Error 1
make[1]: Leaving directory `/home/fidencio/src/gnome/evolution-ews/src/server/tests'
make: *** [check-am] Error 2
Comment 1 Fabiano Fidêncio 2013-03-05 02:24:17 UTC
Created attachment 238073 [details] [review]
server/tests: fix arguments passed e_ews_connection_create_folder
Comment 2 Fabiano Fidêncio 2013-03-05 02:24:21 UTC
Created attachment 238074 [details] [review]
server/tests: fix typo: get_delegate -> info
Comment 3 Fabiano Fidêncio 2013-03-05 02:24:25 UTC
Created attachment 238075 [details] [review]
server/tests: drop deprecated g_thread_init call
Comment 4 Fabiano Fidêncio 2013-03-05 02:24:29 UTC
Created attachment 238076 [details] [review]
server/tests: use EEwsOofSettings instead of OOFSettings

OOFSettings was remove a few time ago and replaced by EEwsOofSettings
Comment 5 Milan Crha 2013-03-07 17:20:13 UTC
Patches looks good, let's extend them to get rid of the crash too + the coding style with space after function name and (void) in function prototypes (I know, it was already there).
Comment 6 Fabiano Fidêncio 2013-03-10 17:05:31 UTC
Created attachment 238533 [details] [review]
Bug #695177 - server/tests: fix make check

- fix arguments passed e_ews_connection_create_folder
- fix typo: get_delegate -> info
- drop deprecated g_thread_init call
- replace OOFSettings by EEwsOofSettings

Tests still are not working. Some comments were done in the code and tips are
welcome about how to proceed with the issues.
Comment 7 Milan Crha 2013-03-11 10:30:58 UTC
Review of attachment 238533 [details] [review]:

::: src/server/tests/test-connection.c
@@ +87,3 @@
+    /*
+     * How to get an EwsUrls here, once the callback was a bit changed?
+     */

the 'object' is CamelEwsSettings, from e_ews_autodiscover_ws_url(), thus I'd cast it to ews_settings and get the information from there.

@@ +130,3 @@
 	g_assert_cmpstr (password, !=, NULL);
 
+

extra space?

::: src/server/tests/test-libews.c
@@ +44,3 @@
+	 * how to proceed?
+	 */
+//	g_test_add_func ("/libews/oofsettingssubmit", oof_settings_submit_test_run);

do not use C++ comments, stick on C comments (// versus /* */)

@@ +49,3 @@
+	 * Unable to get out of office settings: The SMTP address has no mailbox
+	 * associated with it.
+	 * how to proceed?

it might mean that the emaila ddress beign set on the EEwsConnection/CamelEwsSettings is not the one known to the server. Check how you read it from the environment variables (and make sure the env variable is set properly too, like the '@' can be a significant letter for the shell).

@@ +65,3 @@
+	 * Unable to get delegate: The SMTP address has no mailbox associated with
+	 * it.
+	 */

dtto, same as above

::: src/server/tests/test-get-oof-settings.c
@@ +34,3 @@
 #include "utils.h"
 
+void oof_settings_new_test_run ();

use 'void', please (similar on below functions). I know it was done that way earlier too, thus if you could cleanup it, then even better.

::: src/server/tests/test-set-oof-settings.c
@@ +34,3 @@
 #include "utils.h"
 
+void oof_settings_submit_test_run ();

Use 'void' please.
Comment 8 Fabiano Fidêncio 2013-03-11 10:41:41 UTC
(In reply to comment #7)
> Review of attachment 238533 [details] [review]:
> 
> ::: src/server/tests/test-connection.c
> @@ +87,3 @@
> +    /*
> +     * How to get an EwsUrls here, once the callback was a bit changed?
> +     */
> 
> the 'object' is CamelEwsSettings, from e_ews_autodiscover_ws_url(), thus I'd
> cast it to ews_settings and get the information from there.

Ah, right! Thanks.

> 
> @@ +130,3 @@
>      g_assert_cmpstr (password, !=, NULL);
> 
> +
> 
> extra space?

Ooops.

> 
> ::: src/server/tests/test-libews.c
> @@ +44,3 @@
> +     * how to proceed?
> +     */
> +//    g_test_add_func ("/libews/oofsettingssubmit",
> oof_settings_submit_test_run);
> 
> do not use C++ comments, stick on C comments (// versus /* */)

Right, thanks for the heads up.
And, actually, these comments are not going to the code.

> 
> @@ +49,3 @@
> +     * Unable to get out of office settings: The SMTP address has no mailbox
> +     * associated with it.
> +     * how to proceed?
> 
> it might mean that the emaila ddress beign set on the
> EEwsConnection/CamelEwsSettings is not the one known to the server. Check how
> you read it from the environment variables (and make sure the env variable is
> set properly too, like the '@' can be a significant letter for the shell).

The email address is known to the server. Another tests use the same email address to connect in the server and bla, bla, bla without problems.

> 
> @@ +65,3 @@
> +     * Unable to get delegate: The SMTP address has no mailbox associated with
> +     * it.
> +     */
> 
> dtto, same as above
> 
> ::: src/server/tests/test-get-oof-settings.c
> @@ +34,3 @@
>  #include "utils.h"
> 
> +void oof_settings_new_test_run ();
> 
> use 'void', please (similar on below functions). I know it was done that way
> earlier too, thus if you could cleanup it, then even better.
> 
> ::: src/server/tests/test-set-oof-settings.c
> @@ +34,3 @@
>  #include "utils.h"
> 
> +void oof_settings_submit_test_run ();
> 
> Use 'void' please.

Argh! I didn't squash the patch adding void in these functions declarations, sorry.
Comment 9 Fabiano Fidêncio 2013-03-12 14:48:41 UTC
Created attachment 238696 [details] [review]
Bug #695177 - server/tests: fix make check

- fix arguments passed e_ews_connection_create_folder
- fix typo: get_delegate -> info
- drop deprecated g_thread_init call
- replace OOFSettings by EEwsOofSettings
- fix codying style: function_name -> function_name (void)
- disable getattchaments tests for now (it'll be rewrite in a near future)
Comment 10 Milan Crha 2013-03-12 15:07:21 UTC
Review of attachment 238696 [details] [review]:

Looks good, thanks. Fix the only one thing and feel free to commit to master.

::: src/server/tests/test-libews.c
@@ +51,3 @@
 	g_test_add_func ("/libews/cuditem", cuditem_tests_run);
 	g_test_add_func ("/libews/getdelegate", get_delegate_tests_run);
+//	g_test_add_func ("/libews/getattachment", get_attachments_tests_run);

C++-like comment :)