Merge lp:~zorba-coders/zorba/fix-website-failures into lp:zorba

Proposed by Chris Hillery
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10644
Merged at revision: 10644
Proposed branch: lp:~zorba-coders/zorba/fix-website-failures
Merge into: lp:zorba
Diff against target: 354 lines (+46/-31)
24 files modified
CMakeLists.txt (+3/-2)
include/zorba/config.h.cmake (+3/-0)
modules/com/zorba-xquery/www/modules/CMakeLists.txt (+3/-0)
src/context/static_context.cpp (+4/-3)
src/util/http_util.cpp (+7/-2)
src/util/http_util.h (+0/-2)
test/http-test-data/docroot/http-test-data/http2.xml (+4/-0)
test/rbkt/Queries/zorba/fetch/fetch_bogus2.xq (+1/-1)
test/rbkt/Queries/zorba/store/example_3.xq (+4/-4)
test/rbkt/Queries/zorba/versioning/import-chain1.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import-chain2.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import1.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import2.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import3.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import4.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import5.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import6.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import7.xq (+1/-1)
test/rbkt/modules/CMakeLists.txt (+3/-3)
test/rbkt/modules/bad-ver.xq (+1/-1)
test/rbkt/modules/module-A.xq (+1/-1)
test/rbkt/modules/module-B.xq (+1/-1)
test/rbkt/modules/ver.xq (+1/-1)
test/rbkt/modules/ver2.xq (+1/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/fix-website-failures
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Chris Hillery Approve
Review via email: mp+91574@code.launchpad.net

Commit message

Several fixes related to test breakages caused by zorba-xquery.com changes:
1. Don't attempt HTTP resolution w/ HttpStream if Zorba compiled without CURL.
2. store/example_3 test: load content from zorbatest site like other tests.
3. fetch_bogus2 and impot5 test: change "ver" test module to be identified with a flworfound.org URI, so we'll get a 404 when loading it wrong. (Both example.com and zorba-xquery.com don't return 404 for unknown URLs.)

Description of the change

This fixes several problems either caused by the recent zorba-xquery.com changes, or discovered while implementing those fixes.

To post a comment you must log in.
Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/fix-website-failures into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job fix-website-failures-2012-02-05T12-42-57.03Z is
  finished. The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job fix-website-failures-2012-02-05T16-56-51.266Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2012-01-20 13:37:12 +0000
3+++ CMakeLists.txt 2012-02-05 12:38:21 +0000
4@@ -498,14 +498,15 @@
5 # Subdirectory ordering: We need to include "test" before "config" so
6 # ZorbaConfig knows about testdriver. We need to include "config"
7 # before "modules" so external modules will be able to find
8-# ZorbaConfig.cmake.
9+# ZorbaConfig.cmake. We need to include "modules" before "include" so
10+# config.h can know eg. whether we found CURL.
11
12 ADD_SUBDIRECTORY(test)
13 ADD_SUBDIRECTORY(config)
14-ADD_SUBDIRECTORY(include)
15 ADD_SUBDIRECTORY(doc)
16 ADD_SUBDIRECTORY(schemas)
17 ADD_SUBDIRECTORY(modules)
18+ADD_SUBDIRECTORY(include)
19
20 ADD_DEFINITIONS(-Dzorba_EXPORTS)
21 ADD_SUBDIRECTORY(src)
22
23=== modified file 'include/zorba/config.h.cmake'
24--- include/zorba/config.h.cmake 2012-01-11 17:30:25 +0000
25+++ include/zorba/config.h.cmake 2012-02-05 12:38:21 +0000
26@@ -69,6 +69,9 @@
27 #cmakedefine ZORBA_HAVE_MS_UINT32
28 #cmakedefine ZORBA_HAVE_UINT32_T
29
30+// Platform libraries
31+#cmakedefine ZORBA_HAVE_CURL
32+
33 #ifdef ZORBA_HAVE_STDINT_H
34 # include <stdint.h>
35 #endif
36
37=== modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt'
38--- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-01-11 17:30:25 +0000
39+++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-02-05 12:38:21 +0000
40@@ -16,6 +16,7 @@
41 #
42 # cURL
43 #
44+SET (CURL_FOUND)
45 IF(ZORBA_SUPPRESS_CURL)
46 MESSAGE(STATUS "ZORBA_SUPPRESS_CURL is true - not searching for cURL library")
47 ELSE(ZORBA_SUPPRESS_CURL)
48@@ -36,6 +37,8 @@
49 MESSAGE(STATUS "The cURL library was not found - http-client will not be built")
50 ENDIF(CURL_FOUND)
51 ENDIF(ZORBA_SUPPRESS_CURL)
52+SET(ZORBA_HAVE_CURL ${CURL_FOUND} CACHE BOOL "Whether Zorba found cURL" FORCE)
53+MARK_AS_ADVANCED(ZORBA_HAVE_CURL)
54
55 DECLARE_ZORBA_SCHEMA(FILE xqdoc.xsd URI "http://www.xqdoc.org/1.0")
56 DECLARE_ZORBA_MODULE(FILE datetime.xq VERSION 2.0
57
58=== modified file 'src/context/static_context.cpp'
59--- src/context/static_context.cpp 2012-02-02 09:56:52 +0000
60+++ src/context/static_context.cpp 2012-02-05 12:38:21 +0000
61@@ -1569,9 +1569,10 @@
62 for (std::vector<zstring>::iterator url = aUrls.begin();
63 url != aUrls.end(); url++)
64 {
65- // if the http-client module is not available, we must not search
66- // for it by calling the http-client...
67- if (*url == "http://www.zorba-xquery.com/modules/http-client")
68+ // We should never try to load the http-client module using its original URI,
69+ // because that URI starts with http:, so we'll try to load the http-client
70+ // module, leading to a stack overflow.
71+ if (ascii::begins_with(*url, "http://www.zorba-xquery.com/modules/http-client"))
72 {
73 continue;
74 }
75
76=== modified file 'src/util/http_util.cpp'
77--- src/util/http_util.cpp 2012-01-11 17:30:25 +0000
78+++ src/util/http_util.cpp 2012-02-05 12:38:21 +0000
79@@ -28,7 +28,7 @@
80 namespace zorba {
81
82 HttpStream::HttpStream(const zstring& aUri)
83- : theDidInit(false), theUri(aUri)
84+ : theUri(aUri)
85 {
86 }
87
88@@ -42,6 +42,9 @@
89
90 void HttpStream::init()
91 {
92+ bool succeed = false;
93+
94+#ifdef ZORBA_HAVE_CURL
95 Zorba* lInstance = Zorba::getInstance(0);
96 theStaticContext = lInstance->createStaticContext();
97 ItemFactory* lFactory = lInstance->getItemFactory();
98@@ -75,7 +78,7 @@
99 Iterator_t lIter = lItem.getAttributes();
100 lIter->open();
101 Item lAttr;
102- bool succeed = true;
103+ succeed = true;
104 while (lIter->next(lAttr)) {
105 Item lName;
106 lAttr.getNodeName(lName);
107@@ -89,6 +92,8 @@
108 }
109 }
110 lIter->close();
111+#endif /* ZORBA_HAVE_CURL */
112+
113 if (!succeed)
114 throw os_error::exception("", theUri.c_str(), "Could not create stream resource");
115 theIterator->next(theStreamableString);
116
117=== modified file 'src/util/http_util.h'
118--- src/util/http_util.h 2011-08-20 01:30:48 +0000
119+++ src/util/http_util.h 2012-02-05 12:38:21 +0000
120@@ -27,7 +27,6 @@
121 public:
122 std::istream& getStream();
123 void init();
124- bool didInit() { return theDidInit; }
125 StreamReleaser getStreamReleaser();
126 void setStreamReleaser(StreamReleaser aReleaser);
127 private:
128@@ -35,7 +34,6 @@
129 StaticContext_t theStaticContext;
130 Item theStreamableString;
131 Iterator_t theIterator;
132- bool theDidInit;
133 const zstring& theUri;
134 };
135 }
136
137=== added file 'test/http-test-data/docroot/http-test-data/http2.xml'
138--- test/http-test-data/docroot/http-test-data/http2.xml 1970-01-01 00:00:00 +0000
139+++ test/http-test-data/docroot/http-test-data/http2.xml 2012-02-05 12:38:21 +0000
140@@ -0,0 +1,4 @@
141+<x:doc xmlns:x="http://www.zorba-xquery.com/http-test-data">
142+ <x:title>Document Title</x:title>
143+ <x:body>Document Body</x:body>
144+</x:doc>
145
146=== modified file 'test/rbkt/Queries/zorba/fetch/fetch_bogus2.xq'
147--- test/rbkt/Queries/zorba/fetch/fetch_bogus2.xq 2011-08-05 09:31:11 +0000
148+++ test/rbkt/Queries/zorba/fetch/fetch_bogus2.xq 2012-02-05 12:38:21 +0000
149@@ -1,4 +1,4 @@
150 (: Fetch a valid module URI but as SOME_CONTENT :)
151 import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch#2.0";
152
153-fetch:content("http://www.zorba-xquery.com/modules/ext", "SOME_CONTENT")
154+fetch:content("http://www.flworfound.org/modules/ext", "SOME_CONTENT")
155
156=== modified file 'test/rbkt/Queries/zorba/store/example_3.xq'
157--- test/rbkt/Queries/zorba/store/example_3.xq 2011-08-04 02:14:56 +0000
158+++ test/rbkt/Queries/zorba/store/example_3.xq 2012-02-05 12:38:21 +0000
159@@ -2,17 +2,17 @@
160
161 import module namespace doc = "http://www.zorba-xquery.com/modules/store/dynamic/documents";
162
163-declare namespace xhtml = "http://www.w3.org/1999/xhtml";
164+declare namespace x = "http://www.zorba-xquery.com/http-test-data";
165
166-let $mydoc := http:get-node("http://zorba-xquery.com/rest-tests/doc.html")[2]
167+let $mydoc := http:get-node("http://zorbatest.lambda.nu:8080/http-test-data/http2.xml")[2]
168 return
169 {
170 doc:put("mydoc.xml", $mydoc); (: add the document with name mydoc.xml :)
171
172 replace value of node
173- doc:document("mydoc.xml")//xhtml:title
174+ doc:document("mydoc.xml")//x:title
175 with
176 "Excel Functions";
177
178- doc:document("mydoc.xml")//xhtml:title/text()
179+ doc:document("mydoc.xml")//x:title/text()
180 }
181
182=== modified file 'test/rbkt/Queries/zorba/versioning/import-chain1.xq'
183--- test/rbkt/Queries/zorba/versioning/import-chain1.xq 2011-06-06 09:11:29 +0000
184+++ test/rbkt/Queries/zorba/versioning/import-chain1.xq 2012-02-05 12:38:21 +0000
185@@ -1,6 +1,6 @@
186 (: Test that importing a version in the main module and a library module :)
187 (: is OK, so long as the versions don't conflict. :)
188-import module namespace vm = "http://www.zorba-xquery.com/modules/ver#2.3";
189+import module namespace vm = "http://www.flworfound.org/modules/ver#2.3";
190 import module namespace modB = "http://www.zorba-xquery.com/modules/B";
191
192 modB:hello()
193
194=== modified file 'test/rbkt/Queries/zorba/versioning/import-chain2.xq'
195--- test/rbkt/Queries/zorba/versioning/import-chain2.xq 2011-06-06 09:11:29 +0000
196+++ test/rbkt/Queries/zorba/versioning/import-chain2.xq 2012-02-05 12:38:21 +0000
197@@ -1,6 +1,6 @@
198 (: Test that importing a version in the main module and a library module :)
199 (: raises an error when the versions conflict. :)
200 import module namespace modA = "http://www.zorba-xquery.com/modules/A";
201-import module namespace vm = "http://www.zorba-xquery.com/modules/ver#2.3";
202+import module namespace vm = "http://www.flworfound.org/modules/ver#2.3";
203
204 modA:hello()
205
206=== modified file 'test/rbkt/Queries/zorba/versioning/import1.xq'
207--- test/rbkt/Queries/zorba/versioning/import1.xq 2011-06-06 09:11:29 +0000
208+++ test/rbkt/Queries/zorba/versioning/import1.xq 2012-02-05 12:38:21 +0000
209@@ -1,4 +1,4 @@
210 (: Test that we can import a versioned module. :)
211-import module namespace vm = "http://www.zorba-xquery.com/modules/ver#2.1";
212+import module namespace vm = "http://www.flworfound.org/modules/ver#2.1";
213
214 vm:hello()
215
216=== modified file 'test/rbkt/Queries/zorba/versioning/import2.xq'
217--- test/rbkt/Queries/zorba/versioning/import2.xq 2011-06-06 09:11:29 +0000
218+++ test/rbkt/Queries/zorba/versioning/import2.xq 2012-02-05 12:38:21 +0000
219@@ -1,4 +1,4 @@
220 (: Test that importing a versioned module gets the right version. :)
221-import module namespace vm = "http://www.zorba-xquery.com/modules/ver#1.3";
222+import module namespace vm = "http://www.flworfound.org/modules/ver#1.3";
223
224 vm:version()
225
226=== modified file 'test/rbkt/Queries/zorba/versioning/import3.xq'
227--- test/rbkt/Queries/zorba/versioning/import3.xq 2011-06-06 09:11:29 +0000
228+++ test/rbkt/Queries/zorba/versioning/import3.xq 2012-02-05 12:38:21 +0000
229@@ -1,4 +1,4 @@
230 (: Test that importing a range of versions gets the highest available. :)
231-import module namespace vm = "http://www.zorba-xquery.com/modules/ver#1.3-2.0";
232+import module namespace vm = "http://www.flworfound.org/modules/ver#1.3-2.0";
233
234 vm:version()
235
236=== modified file 'test/rbkt/Queries/zorba/versioning/import4.xq'
237--- test/rbkt/Queries/zorba/versioning/import4.xq 2011-06-06 09:11:29 +0000
238+++ test/rbkt/Queries/zorba/versioning/import4.xq 2012-02-05 12:38:21 +0000
239@@ -1,4 +1,4 @@
240 (: Test that importing an explicit version gets the right version. :)
241-import module namespace vm = "http://www.zorba-xquery.com/modules/ver#2.3!";
242+import module namespace vm = "http://www.flworfound.org/modules/ver#2.3!";
243
244 vm:version()
245
246=== modified file 'test/rbkt/Queries/zorba/versioning/import5.xq'
247--- test/rbkt/Queries/zorba/versioning/import5.xq 2011-06-06 09:11:29 +0000
248+++ test/rbkt/Queries/zorba/versioning/import5.xq 2012-02-05 12:38:21 +0000
249@@ -1,4 +1,4 @@
250 (: Test that importing a non-existent explicit version gets an error. :)
251-import module namespace vm = "http://www.zorba-xquery.com/modules/ver#2.2!";
252+import module namespace vm = "http://www.flworfound.org/modules/ver#2.2!";
253
254 vm:version()
255
256=== modified file 'test/rbkt/Queries/zorba/versioning/import6.xq'
257--- test/rbkt/Queries/zorba/versioning/import6.xq 2011-06-21 07:39:45 +0000
258+++ test/rbkt/Queries/zorba/versioning/import6.xq 2012-02-05 12:38:21 +0000
259@@ -1,6 +1,6 @@
260 (: Test that an exact import with non-0 patch level does not match :)
261 (: module with no patch level specified. :)
262-import module namespace vm = "http://www.zorba-xquery.com/modules/ver#2.3.5!";
263+import module namespace vm = "http://www.flworfound.org/modules/ver#2.3.5!";
264
265 vm:version()
266
267
268=== modified file 'test/rbkt/Queries/zorba/versioning/import7.xq'
269--- test/rbkt/Queries/zorba/versioning/import7.xq 2011-06-21 07:39:45 +0000
270+++ test/rbkt/Queries/zorba/versioning/import7.xq 2012-02-05 12:38:21 +0000
271@@ -1,5 +1,5 @@
272 (: Test importing a module with an invalid version specification :)
273
274-import module namespace bad = "http://www.zorba-xquery.com/modules/bad-ver#1.0";
275+import module namespace bad = "http://www.flworfound.org/modules/bad-ver#1.0";
276
277 bad:version()
278
279=== modified file 'test/rbkt/modules/CMakeLists.txt'
280--- test/rbkt/modules/CMakeLists.txt 2012-02-02 09:56:52 +0000
281+++ test/rbkt/modules/CMakeLists.txt 2012-02-05 12:38:21 +0000
282@@ -15,11 +15,11 @@
283 # Build and install any test modules. (Parameters are scrambled about
284 # as a test for DECLARE_ZORBA_MODULE parsing them.)
285 DECLARE_ZORBA_MODULE(FILE "ver2.xq"
286- URI "http://www.zorba-xquery.com/modules/ver" VERSION 2.3 TEST_ONLY)
287-DECLARE_ZORBA_MODULE(URI "http://www.zorba-xquery.com/modules/ver" VERSION 1.4
288+ URI "http://www.flworfound.org/modules/ver" VERSION 2.3 TEST_ONLY)
289+DECLARE_ZORBA_MODULE(URI "http://www.flworfound.org/modules/ver" VERSION 1.4
290 FILE "${CMAKE_CURRENT_SOURCE_DIR}/ver.xq" TEST_ONLY)
291
292-DECLARE_ZORBA_MODULE(URI "http://www.zorba-xquery.com/modules/bad-ver"
293+DECLARE_ZORBA_MODULE(URI "http://www.flworfound.org/modules/bad-ver"
294 FILE "bad-ver.xq" VERSION 1.4 TEST_ONLY)
295
296 DECLARE_ZORBA_MODULE(URI "http://www.zorba-xquery.com/modules/A" VERSION 1.0
297
298=== modified file 'test/rbkt/modules/bad-ver.xq'
299--- test/rbkt/modules/bad-ver.xq 2011-06-21 07:39:45 +0000
300+++ test/rbkt/modules/bad-ver.xq 2012-02-05 12:38:21 +0000
301@@ -1,6 +1,6 @@
302 (: This module has an illegal version specification :)
303
304-module namespace vm = "http://www.zorba-xquery.com/modules/bad-ver";
305+module namespace vm = "http://www.flworfound.org/modules/bad-ver";
306
307 declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
308 declare option ver:module-version "1.4.";
309
310=== modified file 'test/rbkt/modules/module-A.xq'
311--- test/rbkt/modules/module-A.xq 2011-06-21 07:39:45 +0000
312+++ test/rbkt/modules/module-A.xq 2012-02-05 12:38:21 +0000
313@@ -2,7 +2,7 @@
314
315 (: This module exists only to import a specific version of the "ver" module. :)
316
317-import module namespace vm = "http://www.zorba-xquery.com/modules/ver#1.0";
318+import module namespace vm = "http://www.flworfound.org/modules/ver#1.0";
319
320 declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
321 declare option ver:module-version "1.0";
322
323=== modified file 'test/rbkt/modules/module-B.xq'
324--- test/rbkt/modules/module-B.xq 2011-06-21 07:39:45 +0000
325+++ test/rbkt/modules/module-B.xq 2012-02-05 12:38:21 +0000
326@@ -2,7 +2,7 @@
327
328 (: This module exists only to import a specific version of the "ver" module. :)
329
330-import module namespace vm = "http://www.zorba-xquery.com/modules/ver#2.0";
331+import module namespace vm = "http://www.flworfound.org/modules/ver#2.0";
332
333 declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
334 declare option ver:module-version "1.0";
335
336=== modified file 'test/rbkt/modules/ver.xq'
337--- test/rbkt/modules/ver.xq 2011-06-21 07:39:45 +0000
338+++ test/rbkt/modules/ver.xq 2012-02-05 12:38:21 +0000
339@@ -1,4 +1,4 @@
340-module namespace vm = "http://www.zorba-xquery.com/modules/ver";
341+module namespace vm = "http://www.flworfound.org/modules/ver";
342
343 declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
344 declare option ver:module-version "1.4.5";
345
346=== modified file 'test/rbkt/modules/ver2.xq'
347--- test/rbkt/modules/ver2.xq 2011-06-21 07:39:45 +0000
348+++ test/rbkt/modules/ver2.xq 2012-02-05 12:38:21 +0000
349@@ -1,4 +1,4 @@
350-module namespace vm = "http://www.zorba-xquery.com/modules/ver";
351+module namespace vm = "http://www.flworfound.org/modules/ver";
352
353 declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
354 declare option ver:module-version "2.3";

Subscribers

People subscribed via source and target branches