Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdminIT.testBannerMessages failing on Rocky 9 #10312

Closed
donsizemore opened this issue Feb 8, 2024 · 4 comments · Fixed by #10565
Closed

AdminIT.testBannerMessages failing on Rocky 9 #10312

donsizemore opened this issue Feb 8, 2024 · 4 comments · Fixed by #10565
Labels
Size: 30 A percentage of a sprint. 21 hours. (formerly size:33)
Milestone

Comments

@donsizemore
Copy link
Contributor

This test has failed consistently enough on Rocky 9 that I feel it's worth reporting:

"[ERROR] AdminIT.testBannerMessages:863 expected: <OK> but was: <ERROR>"

Unfortunately I don't find anything more helpful in the stack of server.logs generated during end-to-end tests.

Related to #10271

@cmbz cmbz added the Size: 10 A percentage of a sprint. 7 hours. label Feb 15, 2024
@cmbz cmbz moved this to SPRINT READY in IQSS Dataverse Project Feb 15, 2024
@pdurbin pdurbin moved this from SPRINT READY to This Sprint 🏃‍♀️ 🏃 in IQSS Dataverse Project Mar 27, 2024
@donsizemore
Copy link
Contributor Author

@jp-tosca as of May 13 2024 on Rocky 9 this test still fails:
[ERROR] AdminIT.testBannerMessages:864 expected: <OK> but was: <ERROR>

@jp-tosca jp-tosca moved this from This Sprint 🏃‍♀️ 🏃 to In Progress 💻 in IQSS Dataverse Project May 14, 2024
@jp-tosca jp-tosca self-assigned this May 14, 2024
@jp-tosca
Copy link
Contributor

FTR: After some testing it seems that there is something wrong with the endpoint in Rocky IX 🥊.

Thanks @donsizemore for all the help with testing this.

After doing some changes on the test and eliminating points of failure we concluded that in this environment a valid call is producing a success output with an unexpected result.

A simple call like this:

curl -H "Content-type:application/json" -X POST "http://localhost:8080/api/admin/bannerMessage" --data '{"dismissibleByUser":"false","messageTexts":[{"lang":"en","message":"Banner Message For Deletion"},{"lang":"fr","message":"Banner Message For Deletion"}]}'

Will generate in Rocky IX 🥊 the following output:

{"status":"OK","data":{"message":"Banner Message added successfully."}}

But when checking with:

$ curl http://localhost:8080/api/admin/bannerMessage

We get something like this : {"status":"OK","data":[{"id":0,"displayValue":""}]}
When this is expected: {"status":"OK","data":[{"id":0,"displayValue":"Banner Message For Deletion"}]}

So far it doesn't seem to be an exception or anything on the back but I will post as soon as I find more details

@jp-tosca
Copy link
Contributor

jp-tosca commented May 17, 2024

This test is failing because:

if (msgTxt.getLang().equals(BundleUtil.getCurrentLocale().getLanguage())) {

Use the locale to define what message to return, rocky is returning "c".

On the test, this line will call the method UtilIT.getBannerMessageIdFromResponse:

String deleteId = UtilIT.getBannerMessageIdFromResponse(getBannerMessageResponse.getBody().asString());

Which is searching explicitly from this string Banner Message For Deletion:

if (message.equals("Banner Message For Deletion")) {

And the value is empty

{
    "status": "OK",
    "data": [
        {
            "id": 0,
            "displayValue": ""
        }
    ]
}

@donsizemore
Copy link
Contributor Author

This doesn't require code changes within Dataverse -- this problem is specific to the Rocky 9 AWS AMI. Closing in favor of gdcc/dataverse-ansible#352

@jp-tosca jp-tosca added Size: 30 A percentage of a sprint. 21 hours. (formerly size:33) and removed Size: 10 A percentage of a sprint. 7 hours. labels May 17, 2024
@jp-tosca jp-tosca removed their assignment May 18, 2024
@pdurbin pdurbin added this to the 6.3 milestone Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 30 A percentage of a sprint. 21 hours. (formerly size:33)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants