ocis icon indicating copy to clipboard operation
ocis copied to clipboard

Nightly failure at apiActivities

Open amrita-shrestha opened this issue 1 year ago • 5 comments

Describe the bug

Build fails at https://drone.owncloud.com/owncloud/ocis/39169/35/5

@issue-9856
  Scenario: check activity message with different language                                                 # /drone/src/tests/acceptance/features/apiActivities/activities.feature:1236
    Given user "Alice" has uploaded file with content "ownCloud test text file" to "textfile.txt"          # FeatureContext::userHasUploadedAFileWithContentTo()
    And user "Alice" has switched the system language to "de" using the Graph API                          # GraphContext::userHasSwitchedTheSystemLanguageUsingGraphApi()
    When user "Alice" lists the activities for file "textfile.txt" of space "Personal" using the Graph API # GraphContext::userListsTheActivitiesForResourceOfSpaceUsingTheGraphAPI()
    Then the HTTP status code should be "200"                                                              # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And the JSON data of the response should match                                                         # FeatureContext::theJsonDataOfTheResponseShouldMatch()
      """
      {
        "type": "object",
        "required": ["value"],
        "properties": {
          "value": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "type": "object",
              "required": ["id","template","times"],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^%user_id_pattern%$"
                },
                "template": {
                  "type": "object",
                  "required": ["message","variables"],
                  "properties": {
                    "message": {
                      "const": "{user} hat {resource} zu {folder} hinzugefügt"
                    },
                    "variables": {
                      "type": "object",
                      "required": ["resource","space","user"],
                      "properties": {
                        "resource": {
                          "type": "object",
                          "required": ["id","name"],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "%file_id_pattern%"
                            },
                            "name": {
                              "const": "textfile.txt"
                            }
                          }
                        },
                        "space": {
                          "type": "object",
                          "required": ["id","name"],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^%user_id_pattern%!%user_id_pattern%$"
                            },
                            "name": {
                              "const": "Alice Hansen"
                            }
                          }
                        },
                        "user": {
                          "type": "object",
                          "required": ["id","displayName"],
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "%user_id_pattern%"
                            },
                            "displayName": {
                              "const": "Alice"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "times": {
                  "type": "object",
                  "required": ["recordedTime"],
                  "properties": {
                    "recordedTime": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
      """
      Const failed at #->properties:value->items[0]:0->properties:template->properties:message (Swaggest\JsonSchema\Exception\ConstException)

amrita-shrestha avatar Sep 23 '24 04:09 amrita-shrestha

This is probably due to new translations.

Can we test only the original string?

micbar avatar Sep 23 '24 05:09 micbar

Can we test only the original string?

The message in the response is returned in English rather than the preferred language. What do you mean by the original string? Do you mean to test the message in English? @micbar

PrajwolAmatya avatar Sep 23 '24 05:09 PrajwolAmatya

Also in UI the activities are listed in English.

Screenshot from 2024-09-23 11-40-01

There was this similar issue https://github.com/owncloud/ocis/issues/9856 related to activities being listed in English rather than the preferred language which was fixed.

PrajwolAmatya avatar Sep 23 '24 05:09 PrajwolAmatya

@PrajwolAmatya In this particular test, the language is switched to de in a GIVEN step. Tonight, somebody changed the german translation of that string, so that it fails during the nightly run.

@dragonchaser @kulmann we should think about the translation tests IMHO.

  1. We could accept the challenge that the strings can change over night and adapt in the morning
  2. We could create a "testing" language in transifex? I don't know it that would be feasible
  3. Skip the language switch

micbar avatar Sep 23 '24 06:09 micbar

Overwriting custom translation path: https://owncloud.dev/services/activitylog/

PrajwolAmatya avatar Sep 23 '24 08:09 PrajwolAmatya