[MGNLTEST-236] MagnoliaRestClient#nodeExists fails to figure the existence of node-names with UTF8-chars in the node name Created: 22/May/22  Updated: 16/Jun/22  Resolved: 10/Jun/22

Status: Closed
Project: Magnolia Test Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 1.3.2

Type: Bug Priority: Critical
Reporter: Christoph Meier Assignee: Michael Duerig
Resolution: Fixed Votes: 0
Labels: foundation_team
Remaining Estimate: Not Specified
Time Spent: 5.5h
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by MGNLREST-394 REST requests with Umlaut characters ... Closed
relation
is related to MGNLTEST-235 Cleanup fails to delete nodes with UT... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Team: Foundation

 Description   

This leads to a couple of problems with test operating with UTF8-chars in the node name. 

Note that the MagnoliaHttpClient does find such a node (on website workspace) - but the MagnoliaRestClient fails.

    @Test
    @Fixture(fixtureFile = "website.ääööüü.yaml", repository = WEBSITE)
    void nodeExistsWorksForUTF8NodeNames(MagnoliaHttpClient magnoliaHttpClient) throws IOException {
        boolean nodeExistsAccordingToMagnoliaRestClient = client.nodeExists(WEBSITE, "/ääööüü");
        int responseStatus = magnoliaHttpClient.get(
                magnoliaHttpClient.user(new User() {
                    @Override
                    public String getUserName() {
                        return "superuser";
                    }

                    @Override
                    public String getPassword() {
                        return "superuser";
                    }
                }).instance(Instance.DIRECT_AUTHOR).path("/ääööüü").build()).code();
        boolean nodeExistsAccordingToMagnoliaHttpClient = 200 == responseStatus;

        assertEquals(nodeExistsAccordingToMagnoliaHttpClient, nodeExistsAccordingToMagnoliaRestClient);
    }

The above test fails.
While debugging & checking JCR-app. it becomes clear that

  • website.ääööüü.yaml is bootstrapped properly.
  • MagnoliaRestClient cannot find the node with nodeExists
  • but the MagnoliaHttpClient does find the node.

The issue may be ther underlying reason for MGNLTEST-235



 Comments   
Comment by Michael Duerig [ 25/May/22 ]

Fixed through MGNLREST-394. I could verify locally that the test from the description passes now.

Comment by Christoph Meier [ 06/Jun/22 ]

mduerig  - i was on a way closing this - and before doing it a final QA.

I think we should add additional self-tests, where the test must first load and then clean-up a resource with Umlaut in the node-name, as QA-commit.
I forgot to demand this during QA. 

 

We could add something like this to it.info.magnolia.test.fixture.FixtureTest:

    @Order(11)
    @Test
    @Fixture(fixtureFile = "website.ääööüü.yaml", repository = "website")
    @Cleanup("website:/ääööüü")
    void loadAndCleanUpFixtureWithUTF8nodeName(){
        assertTrue(magnoliaRestClient.nodeExists("website", "/ääööüü"));
    }

    @Order(12)
    @Test
    void confirmFixtureWithUTF8nodeNameCleanedUpOnAuthor(){
        assertFalse(magnoliaRestClient.nodeExists("website", "/ääööüü"));
    }

The problem is ... test-fwk atm runs against dx-core-test-webapp::6.2.19 - which comes with REST 2.2.-13 - which does not include the fix on REST (MGNLTEST-236).But maybe Umlaut on REST works on 6.2-branach, which maybe was not "tweaked" by SaaS code ... but I'm unsure ...  When I run the above new self-tests, running against 6.2.19 (deployed via docker) - the 2nd new test fails.

When I run it against ce-test-webapps/master #loadAndCleanUpFixtureWithUTF8nodeName (the loading) fails.
Now I'm really puzzled ...

Comment by Christoph Meier [ 06/Jun/22 ]

I reopen it to check it again.
Maybe I'll do. At least someone should.

Could be that it is just my setup ... and still/again setting-up the proper env to test locally is tricky  

Comment by Christoph Meier [ 07/Jun/22 ]

Adding same comment to both MGNLTEST-236, MGNLTEST-235. Both reopened.

The issues still exist.
What exactly happens?

on release/6.2-branch

File website.ääööüü.yaml can be loaded.
But the assertion

assertTrue(magnoliaRestClient.nodeExists("website", "/ääööüü"));

fails.

AND
@Cleanup("website:/ääööüü")
does not work - silently. (not deleting, but not throwing an exception)

on master:
Unfortunately, exactly the same
and FTR: master contains rest-2.3-SNAPSHOT - which includes the fix on the rest-dsipatcher-servlet

Comment by Michael Duerig [ 07/Jun/22 ]

cmeier , I can't reproduce these failures. Here's what I tried, everything passes for me locally: https://git.magnolia-cms.com/users/mduerig/repos/ce/commits/761a9560a89710bed25e894a786b3c1a9f2b9571

Comment by Christoph Meier [ 08/Jun/22 ]

mduerig 

Weird that I have failures on my side.

Would you mind adding these 2 methods to it.info.magnolia.test.fixture.FixtureTest (self-test)?

	@Order(11)
    @Test
    @Fixture(fixtureFile = "website.ääööüü.yaml", repository = "website")
    @Cleanup("website:/ääööüü")
    void loadAndCleanUpFixtureWithUTF8nodeName(){
        assertTrue(magnoliaRestClient.nodeExists("website", "/ääööüü"));
    }

    @Order(12)
    @Test
    void confirmFixtureWithUTF8nodeNameCleanedUpOnAuthor(){
        assertFalse(magnoliaRestClient.nodeExists("website", "/ääööüü"));
    }

We should have theme in any case.

And they also should pass then in consequence on your env (and on jenkins).

And sorry for bothering you with this.

Generated at Mon Feb 12 07:46:55 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.