Story #6465

[Tests] Optimize workbench integration tests

Added by Radhika Chippada about 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
07/15/2015
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-

Description

Convert any integration tests that can be controller tests into controller tests to reduce run time.


Subtasks

Task #6632: Review Branch 6465-optimize-workbench-integration-testsResolvedManoj Malipeddu


Related issues

Related to Arvados - Feature #5259: [Tests] Reduce dependency on integration testsNew01/05/2015

Associated revisions

Revision ddb83a22
Added by Manoj Malipeddu about 4 years ago

closes #6465
Merge branch '6465-optimize-workbench-integration-tests'

Revision 151064a2
Added by Manoj Malipeddu about 4 years ago

refs #6465
Merge branch '6465-optimize-workbench-integration-tests'

Revision fe0e1802
Added by Manoj Malipeddu about 4 years ago

refs #6465
Merge branch '6465-optimize-workbench-integration-tests'

Revision 0964a1c6
Added by Radhika Chippada about 4 years ago

refs #6465
Merge branch '6465-optimize-workbench-integration-tests'

History

#1 Updated by Manoj Malipeddu about 4 years ago

  • Assigned To set to Manoj Malipeddu

#2 Updated by Manoj Malipeddu about 4 years ago

In fc2dc01f:

Removed tests from project_test:
Find a project and edit description to textile description
Find a project and edit description to html description
Find a project and edit description to textile description with link to object
Left "find a project and edit description" to test if edit button works and the x-editable works

Removed test from anonymous_access_test:
anonymous user accesses collection in shared project

Added tests to projects_controller_test:
find a project and edit its description
find a project and edit description to textile description
find a project and edit description to html description
find a project and edit description to textile description with link to object

Added test to collections_controller_test:
anonymous user accesses collection in shared project

#3 Updated by Manoj Malipeddu about 4 years ago

In a00eab83a1a2636f5c18be8109f73bf050d1ec88

Removed test from project_test:
project viewer can't see project sharing tab

Added test to projects_controller_test:
project viewer can't see project sharing tab

#4 Updated by Manoj Malipeddu about 4 years ago

In 5106490f

Removed test from projects_test:
Add a new name, then edit it, without creating a duplicate

Added test to application_controller_test:
Edit name and verify that a duplicate is not created

#5 Updated by Manoj Malipeddu about 4 years ago

In e59b42354a10079ecd579a1dbe53c39a20d05313:

Added test to projects_controller_test:
#{username} can see project sharing tab

Added tests to users_controller_test:
access users page as #{username} and verify show button is available
access settings drop down menu as #{username}

Removed tests from users_test:
login as #{username} and access show button
admin user can access another user page

#6 Updated by Manoj Malipeddu about 4 years ago

  • Status changed from New to In Progress
  • Target version set to 2015-07-22 sprint

#7 Updated by Manoj Malipeddu about 4 years ago

In c3a7bb61e982ff5b0747204b79c4ca759c19b537:

Added tests to collections_controller_test:
can view empty collection
collection portable data hash redirect
collection portable data hash with multiple matches
collection page renders name
no Upload tab on non-writable collection

Removed tests from collections_test:
Collection page renders name
can view empty collection
Collection portable data hash redirect
Collection portable data hash with multiple matches

Left test "Collection portable data hash with multiple matches with more than one page of results"

Removed test from collection_upload_test:
No Upload tab on non-writable collection

#8 Updated by Peter Amstutz about 4 years ago

Comments:

In "find a project and edit description to html description"

 assert_match /Textile description with link to home page .*a href=.*take me home.*\/a.*./, @response.body

Please don't use the wildcard match ".*" this way because ".*" can match any amount of text including none, so it may not catch the mistakes we're trying to test for compared to a regex that matches more precisely.

Same comment applies for the patterns in "find a project and edit description to textile description with link to object" and "access users page as #{username} and verify show button is available", "collection page renders name" and possibly other places.

Thanks.

#9 Updated by Manoj Malipeddu about 4 years ago

In 7253b0d4cdf9612a4c0de0ca849979cec5e8d382:

Changed tests to use the wildcard match less often.

#10 Updated by Peter Amstutz about 4 years ago

I'm a little puzzled by this test. Doesn't "refute_includes" check that "Link to object" is not in the response? Shouldn't we be expecting "Link to object" in the response (assert_includes) ?

  test "find a project and edit description to textile description with link to object" do
    project = api_fixture('groups')['aproject']
    use_token :active
    found = Group.find(project['uuid'])
    found.description = '"Link to object":' + api_fixture('groups')['asubproject']['uuid']
    found.save!
    get(:show, {id: project['uuid']}, session_for(:active))
    refute_includes  @response.body,'"Link to object"'
    refute_empty css_select('[href="/groups/zzzzz-j7d0g-axqo7eu9pwvna1x"]')
  end

#11 Updated by Peter Amstutz about 4 years ago

Explained in chat:

Because the test is actually checking that the Textile rendering is turning "Link to object" into a link (the quotes are part of textile).

Please add comments, rest of it LGTM.

#12 Updated by Manoj Malipeddu about 4 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:ddb83a220cd6f3b62171c3c374c58e553d82a5d6.

#13 Updated by Manoj Malipeddu about 4 years ago

  • Status changed from Resolved to In Progress

In 6d1fb016135e6126c1d5c17ca02f210ba98dfc13:

Added tests to projects_controller_test:
#{user} can move subproject from project #{can_move}
test dashboard button all #{target}

Removed tests from projects_test:
Test dashboard button all #{target}
#{user} can move subproject under another user's Home #{can_move}

#14 Updated by Peter Amstutz about 4 years ago

Additional tests in 6d1fb016135e6126c1d5c17ca02f210ba98dfc13 look good to me.

#15 Updated by Radhika Chippada about 4 years ago

  • Status changed from In Progress to Resolved

#16 Updated by Radhika Chippada about 4 years ago

4b8ecdc4d88c9dccbbcf07b5037ba4dcf4ea2d20

Noticed a slight dip in code coverage in two areas and added tests to cover those situations. Details:

1. Removal of integration "Test dashboard button all {jobs}" resulted in no test at all to visit /jobs page. Added a controller test for this.

2. Not visiting the hash match page when only one collection matches (the controller test just verified the redirection), resulted in the unforeseen side effect of not testing preview allowed status for a file name extention that is not listed in application_mimetypes_with_view_icon (tar file in this case). Added this to test.

Also available in: Atom PDF