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

[#49285] Fix flaky specs modules/storages/spec/features/{manage_project_storage_spec.rb,create_file_links_spec.rb} #13236

Conversation

akabiru
Copy link
Member

@akabiru akabiru commented Jul 25, 2023

https://community.openproject.org/work_packages/49285

Failures:

  1) Activation of storages in projects adds, edits and removes storages to projects
     Failure/Error: Unable to find matching line from backtrace

       expected to find visible select box "storages_project_storage_storage_id" that is not disabled with options ["Storage 1 (nextcloud)"] but there were no matches. Also found "Storage 3 (nextcloud)", which matched the selector but not all filters. Expected options ["Storage 1 (nextcloud)"] found ["Storage 3 (nextcloud)"]
 1st Try error in ./modules/storages/spec/features/create_file_links_spec.rb:85:
Real HTTP connections are disabled. Unregistered request: GET https://host2.example.com/ocs/v1.php/cloud/user with headers {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'***', 'Host'=>'host2.example.com', 'Ocs-Apirequest'=>'true', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}

You can stub this request with the following snippet:

stub_request(:get, "https://host2.example.com/ocs/v1.php/cloud/user").
  with(
    headers: {
	  'Accept'=>'application/json',
	  'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
	  'Authorization'=>'***',
	  'Host'=>'host2.example.com',
	  'Ocs-Apirequest'=>'true',
	  'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
    }).
  to_return(status: 200, body: "", headers: {})

registered request stubs:

stub_request(:propfind, "https://host2.example.com/remote.php/dav/files/admin/Folder1")
stub_request(:propfind, "https://host2.example.com/remote.php/dav/files/admin/")
stub_request(:get, "https://host1.example.com/ocs/v1.php/cloud/user").
  with(
    headers: {
	  'Accept'=>'application/json',
	  'Authorization'=>'***',
	  'Host'=>'host1.example.com',
	  'Ocs-Apirequest'=>'true'
    })

Base automatically changed from feature/48413-danger-zone-when-deactivating-a-storage-on-a-project to dev July 26, 2023 11:17
@akabiru akabiru force-pushed the code-maintenance/49285-fix-flaky-spec-modulesstoragesspecfeaturesmanage_project_storage_specrb1 branch from 95cd0ea to 2263410 Compare July 26, 2023 11:57
@akabiru akabiru changed the title [#49285] Fix flaky spec ./modules/storages/spec/features/manage_project_storage_spec.rb:91 [#49285] Fix flaky specs modules/storages/spec/features/{manage_project_storage_spec.rb,create_file_links_spec.rb} Jul 26, 2023
@akabiru akabiru marked this pull request as ready for review July 26, 2023 11:59
@akabiru akabiru requested a review from ba1ash July 26, 2023 12:23
@akabiru akabiru self-assigned this Jul 26, 2023
@akabiru akabiru requested review from a team and removed request for ba1ash July 26, 2023 14:07
Copy link
Member

@ba1ash ba1ash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ba1ash ba1ash merged commit 4dbc399 into dev Jul 26, 2023
11 checks passed
@ba1ash ba1ash deleted the code-maintenance/49285-fix-flaky-spec-modulesstoragesspecfeaturesmanage_project_storage_specrb1 branch July 26, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants