owncloud / owncloud-sdk

:cloud: ownCloud client library for JavaScript
https://owncloud.dev/owncloud-sdk/
MIT License
75 stars 33 forks source link

Provider tests against oC10 failing nightly #1159

Closed saw-jan closed 2 years ago

saw-jan commented 2 years ago

Builds: https://drone.owncloud.com/owncloud/owncloud-sdk/3847/9/11, https://drone.owncloud.com/owncloud/owncloud-sdk/3846/9/11

Verifying a pact between owncloud-sdk and oc-server-pendingOn-ocis

...
  as 'testUser1', a POST request to share a file 'test space and + and #.txt' to user with expiration date set
    returns a response which
      has status code 200 (OK)
      includes headers
        "Content-Type" with value "text/xml; charset=utf-8" (OK)
      has a matching body (FAILED)
  as 'testUser1', a POST request to share a file 'test.txt' to user with expiration date set
    returns a response which
      has status code 200 (OK)
      includes headers
        "Content-Type" with value "text/xml; charset=utf-8" (OK)
      has a matching body (FAILED)
  as 'testUser1', a POST request to share a file '文件.txt' to user with expiration date set
    returns a response which
      has status code 200 (OK)
      includes headers
        "Content-Type" with value "text/xml; charset=utf-8" (OK)
      has a matching body (FAILED)
...
1) Verifying a pact between owncloud-sdk and oc-server-pendingOn-ocis Given the user is recreated And the user is recreated And file exists - as 'testUser1', a POST request to share a file 'test space and + and #.txt' to user with expiration date set returns a response which 
    1.1) has a matching body
           $.ocs.data -> Expected child <displayname_file_owner/> but was missing
           $.ocs.data -> Expected child <displayname_owner/> but was missing
           $.ocs.data -> Expected child <expiration/> but was missing
           $.ocs.data -> Expected child <file_target/> but was missing
           $.ocs.data -> Expected child <id/> but was missing
           $.ocs.data -> Expected child <path/> but was missing
           $.ocs.data -> Expected child <permissions/> but was missing
           $.ocs.data -> Expected child <share_type/> but was missing
           $.ocs.data -> Expected child <stime/> but was missing
           $.ocs.data -> Expected child <uid_file_owner/> but was missing
           $.ocs.data -> Expected child <uid_owner/> but was missing
           $.ocs.meta.message.#text -> Expected 'Expiration date is in the past' to match '(OK)?'
           $.ocs.meta.statuscode.#text -> Expected '100' to be equal to '404'
           $.ocs.meta.status.#text -> Expected 'ok' to be equal to 'failure'
2) Verifying a pact between owncloud-sdk and oc-server-pendingOn-ocis Given the user is recreated And the user is recreated And file exists - as 'testUser1', a POST request to share a file 'test.txt' to user with expiration date set returns a response which 
    2.1) has a matching body
           $.ocs.meta.message.#text -> Expected 'Expiration date is in the past' to match '(OK)?'
           $.ocs.data -> Expected child <displayname_file_owner/> but was missing
           $.ocs.data -> Expected child <displayname_owner/> but was missing
           $.ocs.data -> Expected child <expiration/> but was missing
           $.ocs.data -> Expected child <file_target/> but was missing
           $.ocs.data -> Expected child <id/> but was missing
           $.ocs.data -> Expected child <path/> but was missing
           $.ocs.data -> Expected child <permissions/> but was missing
           $.ocs.data -> Expected child <share_type/> but was missing
           $.ocs.data -> Expected child <stime/> but was missing
           $.ocs.data -> Expected child <uid_file_owner/> but was missing
           $.ocs.data -> Expected child <uid_owner/> but was missing
           $.ocs.meta.status.#text -> Expected 'ok' to be equal to 'failure'
           $.ocs.meta.statuscode.#text -> Expected '100' to be equal to '404'
3) Verifying a pact between owncloud-sdk and oc-server-pendingOn-ocis Given the user is recreated And the user is recreated And file exists - as 'testUser1', a POST request to share a file '文件.txt' to user with expiration date set returns a response which 
    3.1) has a matching body
           $.ocs.meta.statuscode.#text -> Expected '100' to be equal to '404'
           $.ocs.meta.message.#text -> Expected 'Expiration date is in the past' to match '(OK)?'
           $.ocs.data -> Expected child <displayname_file_owner/> but was missing
           $.ocs.data -> Expected child <displayname_owner/> but was missing
           $.ocs.data -> Expected child <expiration/> but was missing
           $.ocs.data -> Expected child <file_target/> but was missing
           $.ocs.data -> Expected child <id/> but was missing
           $.ocs.data -> Expected child <path/> but was missing
           $.ocs.data -> Expected child <permissions/> but was missing
           $.ocs.data -> Expected child <share_type/> but was missing
           $.ocs.data -> Expected child <stime/> but was missing
           $.ocs.data -> Expected child <uid_file_owner/> but was missing
           $.ocs.data -> Expected child <uid_owner/> but was missing
           $.ocs.meta.status.#text -> Expected 'ok' to be equal to 'failure'
FAIL tests/providerTest.js (236.659 s)
  provider testing
    oc10 as provider
      ✓ verifies the contract with finished interactions (97939 ms)
      ✕ verifies the contract pending on ocis (70699 ms)
      ✓ verifies the contract pending on oC10 (3023 ms)
      ✓ verifies the contract pending on oC10 & ocis (63846 ms)
    ocis as provider
      ○ skipped verifies the contract with finished interactions
      ○ skipped verifies the contract pending on oC10
      ○ skipped verifies the contract pending on ocis
      ○ skipped verifies the contract pending on oC10 & ocis

  ● provider testing › oc10 as provider › verifies the contract pending on ocis
SagarGi commented 2 years ago

The failure seems to be the expiration date (expiration date is used old than the current date)

saw-jan commented 2 years ago

Fix has been merged!

SwikritiT commented 2 years ago
FAIL tests/providerTest.js (230.021 s)
  provider testing
    oc10 as provider
      ✓ verifies the contract with finished interactions (93124 ms)
      ✕ verifies the contract pending on ocis (69626 ms)
      ✓ verifies the contract pending on oC10 (2938 ms)
      ✓ verifies the contract pending on oC10 & ocis (63303 ms)
    ocis as provider
      ○ skipped verifies the contract with finished interactions
      ○ skipped verifies the contract pending on oC10
      ○ skipped verifies the contract pending on ocis
      ○ skipped verifies the contract pending on oC10 & ocis

  ● provider testing › oc10 as provider › verifies the contract pending on ocis

    assert.fail(received, expected)

    Message:
      assert.fail()

      391 |         console.log('Result:', output)
      392 |       }).catch(function () {
    > 393 |         chai.assert.fail()
          |                     ^
      394 |       })
      395 |     }, TEST_TIMEOUT)
      396 |

      at tests/providerTest.js:393:21

failing in recent nightly too https://drone.owncloud.com/owncloud/owncloud-sdk/3865/9/11

grgprarup commented 2 years ago

Failed on today's nightly build. https://drone.owncloud.com/owncloud/owncloud-sdk/3869/9/11

saw-jan commented 2 years ago

Failed on today's nightly build. https://drone.owncloud.com/owncloud/owncloud-sdk/3869/9/11

Yeah, should have passed. This is so weird. Assuming that the failure is due to the timing of the nightly run, even re-running the nightly build at other time it fails

SagarGi commented 2 years ago

This issue is a hard failure only on nightly. Does not fail on PRs. i have checked drone pipeline comparison for normal debug PR and nightly seems same. Very hard to reproduce the nightly failure locally.

grgprarup commented 2 years ago

Failed on today's nightly build. https://drone.owncloud.com/owncloud/owncloud-sdk/3869/9/11

SagarGi commented 2 years ago

@saw-jan $.ocs.meta.message.#text -> Expected 'Expiration date is in the past' to match '(OK)?' todays nightly failure has this error for each failing test. Seems seems like in nightly expiration date is not updated.

saw-jan commented 2 years ago

The nightly failure was due to the failure in downloading the correct consumer pact file using the tag name. We are currently using DRONE_SOURCE_BRANCH to create a tag for the pact versions and also to download the correct pact version using this tag. But in cron builds, this env will be undefined thus causing the failure to download the latest expected pact version using DRONE_SOURCE_BRANCH as a tag name.