Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.06k stars 1.19k forks source link

[Test] some xml tests failed in Firefox #11655

Open jeremymeng opened 3 years ago

jeremymeng commented 3 years ago

Seems to be related to xml namespace. /cc @joheredi

Firefox 81.0 (Windows 10) ServiceClient serializeRequestBody() should serialize an XML String request body with namespace FAILED
        expected '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bodyArg>body value</bodyArg>' to equal '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bodyArg xmlns="https://microsoft.com">body value</bodyArg>'
        AssertionError@dist-test/coreHttp.browser.test.js:328:17
        assertion/Assertion.prototype.assert@dist-test/coreHttp.browser.test.js:3802:17
        assertEqual@dist-test/coreHttp.browser.test.js:4853:16
        methodWrapper@dist-test/coreHttp.browser.test.js:2742:29
        assert/assert.strictEqual@dist-test/coreHttp.browser.test.js:8092:62
        @dist-test/coreHttp.browser.test.js:45884:26

Firefox 81.0 (Windows 10) ServiceClient serializeRequestBody() should serialize an XML ByteArray request body with namespace FAILED
        expected '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bodyArg>SmF2YXNjcmlwdA==</bodyArg>' to equal '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bodyArg xmlns="https://microsoft.com">SmF2YXNjcmlwdA==</bodyArg>'
        AssertionError@dist-test/coreHttp.browser.test.js:328:17
        assertion/Assertion.prototype.assert@dist-test/coreHttp.browser.test.js:3802:17
        assertEqual@dist-test/coreHttp.browser.test.js:4853:16
        methodWrapper@dist-test/coreHttp.browser.test.js:2742:29
        assert/assert.strictEqual@dist-test/coreHttp.browser.test.js:8092:62
        @dist-test/coreHttp.browser.test.js:46048:26

Firefox 81.0 (Windows 10) ServiceClient serializeRequestBody() should serialize an XML Composite request body FAILED
        expected '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><entry><updated>2020-08-12T23:36:18.308Z</updated><content type="application/xml"><QueueDescription><MaxDeliveryCount>15</MaxDeliveryCount></QueueDescription></content></entry>' to equal '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><entry xmlns="http://www.w3.org/2005/Atom"><updated xmlns="http://www.w3.org/2005/Atom">2020-08-12T23:36:18.308Z</updated><content xmlns="http://www.w3.org/2005/Atom" type="application/xml"><QueueDescription xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"><MaxDeliveryCount xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect">15</MaxDeliveryCount></QueueDescription></content></entry>'
        AssertionError@dist-test/coreHttp.browser.test.js:328:17
        assertion/Assertion.prototype.assert@dist-test/coreHttp.browser.test.js:3802:17
        assertEqual@dist-test/coreHttp.browser.test.js:4853:16
        methodWrapper@dist-test/coreHttp.browser.test.js:2742:29
        assert/assert.strictEqual@dist-test/coreHttp.browser.test.js:8092:62
        @dist-test/coreHttp.browser.test.js:46091:26

Firefox 81.0 (Windows 10) ServiceClient serializeRequestBody() should serialize an XML Array request body with namespace and prefix FAILED
        expected '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bodyArg><testItem>Foo</testItem><testItem>Bar</testItem></bodyArg>' to equal '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bodyArg xmlns="https://microsoft.com"><testItem xmlns="https://microsoft.com/element">Foo</testItem><testItem xmlns="https://microsoft.com/element">Bar</testItem></bodyArg>'
        AssertionError@dist-test/coreHttp.browser.test.js:328:17
        assertion/Assertion.prototype.assert@dist-test/coreHttp.browser.test.js:3802:17
        assertEqual@dist-test/coreHttp.browser.test.js:4853:16
        methodWrapper@dist-test/coreHttp.browser.test.js:2742:29
        assert/assert.strictEqual@dist-test/coreHttp.browser.test.js:8092:62
        @dist-test/coreHttp.browser.test.js:46137:26

Firefox 81.0 (Windows 10) ServiceClient serializeRequestBody() should serialize an XML Array of composite elements, namespace and prefix FAILED
        expected '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bodyArg><testItem><Foo>Foo1</Foo><Bar xmlns:bar="https://microsoft.com/bar">Bar1</Bar></testItem><testItem><Foo>Foo2</Foo><Bar xmlns:bar="https://microsoft.com/bar">Bar2</Bar></testItem><testItem><Foo>Foo3</Foo><Bar xmlns:bar="https://microsoft.com/bar">Bar3</Bar></testItem></bodyArg>' to equal '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bodyArg xmlns="https://microsoft.com"><testItem xmlns="https://microsoft.com/element"><Foo xmlns="https://microsoft.com/foo">Foo1</Foo><Bar xmlns:bar="https://microsoft.com/bar">Bar1</Bar></testItem><testItem xmlns="https://microsoft.com/element"><Foo xmlns="https://microsoft.com/foo">Foo2</Foo><Bar xmlns:bar="https://microsoft.com/bar">Bar2</Bar></testItem><testItem xmlns="https://microsoft.com/element"><Foo xmlns="https://microsoft.com/foo">Foo3</Foo><Bar xmlns:bar="https://microsoft.com/bar">Bar3</Bar></testItem></bodyArg>'
        AssertionError@dist-test/coreHttp.browser.test.js:328:17
        assertion/Assertion.prototype.assert@dist-test/coreHttp.browser.test.js:3802:17
        assertEqual@dist-test/coreHttp.browser.test.js:4853:16
        methodWrapper@dist-test/coreHttp.browser.test.js:2742:29
        assert/assert.strictEqual@dist-test/coreHttp.browser.test.js:8092:62
        @dist-test/coreHttp.browser.test.js:46217:26

Firefox 81.0 (Windows 10) ServiceClient serializeRequestBody() should serialize an XML Composite request body with namespace and prefix FAILED
        expected '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bodyArg><Foo>Foo</Foo><Bar xmlns:bar="https://microsoft.com/bar">Bar</Bar></bodyArg>' to equal '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bodyArg xmlns="https://microsoft.com"><Foo xmlns="https://microsoft.com/foo">Foo</Foo><Bar xmlns:bar="https://microsoft.com/bar">Bar</Bar></bodyArg>'
        AssertionError@dist-test/coreHttp.browser.test.js:328:17
        assertion/Assertion.prototype.assert@dist-test/coreHttp.browser.test.js:3802:17
        assertEqual@dist-test/coreHttp.browser.test.js:4853:16
        methodWrapper@dist-test/coreHttp.browser.test.js:2742:29
        assert/assert.strictEqual@dist-test/coreHttp.browser.test.js:8092:62
        @dist-test/coreHttp.browser.test.js:46259:26

Chrome Headless 83.0.4103.0 (Windows 10): Executed 439 of 439 SUCCESS (4.475 secs / 3.842 secs)
Firefox 81.0 (Windows 10): Executed 439 of 439 (6 FAILED) (3.392 secs / 1.535 secs)
TOTAL: 6 FAILED, 872 SUCCESS
joheredi commented 3 years ago

Hmm looks like we're not getting the expected namespace. I'm looking into this now

xirzec commented 1 year ago

@jeremymeng @joheredi is this still a concern with core-xml?

joheredi commented 1 year ago

I think it is still an issue, I think we'll need to re-think the initial approach for supporting xml namespaces. IIRC this effort started to support swagger generation for ServiceBus, however, I'm not sure if we actually made progress with the Swagger itself.

jeremymeng commented 1 year ago

If we still want to generate code for service bus management client, I probably would prefer cadl route now. Though maybe generating from cadl would still have the same issue?

github-actions[bot] commented 6 months ago

Hi @jeremymeng, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.