ERROR: test_generate_static_docs_does_not_smoke (cuddlefish.tests.test_server.ServerTests)

RESOLVED FIXED

Status

RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: ashah, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
SDK: 1.0b3 RC1
Browser: FFx 4.0b11
Platform: Win 7

I ran my integration script against the RC1 and found the following error:

"ERROR: test_generate_static_docs_does_not_smoke (cuddlefish.tests.test_server.Se rverTests)"
The traceback is as follows:

Traceback (most recent call last):
  File "C:\Users\mozilla\Downloads\addon-sdk-1.0b3\python-lib\cuddlefish\tests\t
est_server.py", line 13, in test_generate_static_docs_does_not_smoke
    server.generate_static_docs(env_root, tgz_filename=filename)
  File "C:\Users\mozilla\Downloads\addon-sdk-1.0b3\python-lib\cuddlefish\server.
py", line 355, in generate_static_docs
    package_doc_html = web_docs.create_package_page(src_dir)
  File "C:\Users\mozilla\Downloads\addon-sdk-1.0b3\python-lib\cuddlefish\webdocs
.py", line 81, in create_package_page
    package_content = self._create_package_detail(package_name)
  File "C:\Users\mozilla\Downloads\addon-sdk-1.0b3\python-lib\cuddlefish\webdocs
.py", line 166, in _create_package_detail
    raise IOError(errno.ENOENT, 'Package not found')
IOError: [Errno 2] Package not found


Logs are available at http://pastebin.mozilla.org/1088089

Note: FYI, The command that is executed from inside the integration script is:
"cfx testall -b /Applications/Firefox4.0b11/Firefox.app"
(Reporter)

Comment 1

8 years ago
Happens on Windows XP as well
Will, Warner: any thoughts on this?
(In reply to comment #2)
> Will, Warner: any thoughts on this?

Probably that 'package_name = path.split('/')[-1]' will not work on Windows, and needs to be something like:

     def create_package_page(self, path):
         path, ext = os.path.splitext(path)
-        package_name = path.split('/')[-1]
+        head, package_name = os.path.split(path)
         package_content = self._create_package_detail(package_name)
         return self._create_page(package_content)
Blocks: 631675
yeah, that ought to do it.

I skimmed webdocs.py, it didn't look like any other code is relying upon non-platform-specific separators. But is there anything in there which copies a multi-part OS-side path into a URL path? Which might get messed up when the OS side uses backslashes? Like ...\parentdir\packagename\modname which should be exposed as "parentdir/packagename/modname" not "parentdir\packagename/modname"?
Will: can you put together a patch for Brian to review?
Created attachment 514358 [details] [diff] [review]
Fix webd-docs for Windows
Attachment #514358 - Flags: review?(warner-bugzilla)
Comment on attachment 514358 [details] [diff] [review]
Fix webd-docs for Windows

looks great!
Attachment #514358 - Flags: review?(warner-bugzilla) → review+
Landed in https://github.com/mozilla/addon-sdk/commit/9f0477b368d020b2e4bd267092979def4f00fc19
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.