cfx testcfx failing on Windows.

RESOLVED FIXED

Status

Add-on SDK
General
P1
normal
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: KWierso, Assigned: KWierso)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

6 years ago
Created attachment 663211 [details] [diff] [review]
fix it

All Windows test runs are currently failing, due to this:

FAIL: test_contents (cuddlefish.tests.test_xpi.SmallXPI)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "C:\talos-slave\test\addonsdk-poller\addon-sdk-8d61f5d18ce1\python-lib\cuddlefish\tests\test_xpi.py", line 196, in test_contents

    self.failUnlessEqual(list(missing), [])

AssertionError: ['C:\\talos-slave\\test\\addonsdk-poller\\addon-sdk-8d61f5d18ce1\\packages\\api-utils\\lib\\utils/object.js', 'C:\\talos-slave\\test\\addonsdk-poller\\addon-sdk-8d61f5d18ce1\\packages\\api-utils\\lib\\url/io.js'] != []

In the test, io.js and object.js are specified as "url/io.js" and "utils/object.js", which is then being directly appended to the (supposed-to-be) platform specific path to those files, which is wrong on Windows.

So, this patch just uses os.path.join to get the platform-specific paths to those modules.
Attachment #663211 - Flags: review?(rFobic)
(Assignee)

Comment 1

6 years ago
Tests pass for me with this patch locally on both Ubuntu and Windows, for what it's worth.
(Assignee)

Updated

6 years ago
Assignee: nobody → kwierso
Priority: -- → P1
(Assignee)

Updated

6 years ago
Blocks: 748086
(Assignee)

Updated

6 years ago
OS: Linux → All
Hardware: x86 → All
(Assignee)

Comment 2

6 years ago
Created attachment 663224 [details] [diff] [review]
Fix all of url/io

As it turns out, url/io tests were actually failing beyond the testcfx stuff.

Line endings are different on Windows, so the tests checking against unix line endings were failing.
Attachment #663211 - Attachment is obsolete: true
Attachment #663211 - Flags: review?(rFobic)
Attachment #663224 - Flags: review?(rFobic)
Wes, if it's fine for Irakli I can review this patch.

In order to simplify the test, I will suggest to revert the `test-uri-io.txt` to the original form, that was without new line at the end. I changed it during the review process, and now I realize the mistake. If we remove the new line from that file, then we don't have to branch based on the OS the constants, and they will simply be:

    const utf8text = "Hello, ゼロ!";
    const latin1text = "Hello, ゼロ!";

The python code looks ok to me!
(Assignee)

Comment 4

6 years ago
Created attachment 663523 [details] [diff] [review]
remove newline from test file

Here's a version that removes the newline character.
Attachment #663224 - Attachment is obsolete: true
Attachment #663224 - Flags: review?(rFobic)
Attachment #663523 - Flags: review?(zer0)
Comment on attachment 663523 [details] [diff] [review]
remove newline from test file

I trust you the character is removed, because the diff doesn't show new line chars. ;)
Attachment #663523 - Flags: review?(zer0) → review+

Updated

6 years ago
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Comment 7

6 years ago
Looks like tests are passing with this, so I went ahead and pushed to inbound: 
https://hg.mozilla.org/integration/mozilla-inbound/rev/f7354c77ad5c
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
https://hg.mozilla.org/mozilla-central/rev/f7354c77ad5c
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.