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

Add Autoscaler e2e tests #3681

Merged
merged 33 commits into from
Dec 12, 2019
Merged

Add Autoscaler e2e tests #3681

merged 33 commits into from
Dec 12, 2019

Conversation

zyjiaobj
Copy link
Contributor

@zyjiaobj zyjiaobj commented Jun 26, 2019

End2end test for autoscaler tab:

  • deploy a new application from github url
  • go to autoscaler tab, the status should be disabled since no policy is attached
  • go to enable it by creating a policy and save
  • go to edit policy from instance number setting, trigger table, schedule table of the autoscaler tab
  • go to metrics page from autoscaler tab
  • go to scaling event page from autoscaler tab
  • delete the application

Test log:

  Autoscaler -

    Should deploy app from Git URL
      ✓ Check deploy steps
      ✓ Should pass CF/Org/Space Step
      ✓ Should pass Source step
      ✓ Should pass Source Config step
      ✓ Should pass Overrides step
      ✓ Should Deploy Application
      ✓ Should go to App Summary Page

    Tab Tests -
      ✓ Autoscale Tab -- Disabled

    Autoscaler Attach Policy -
      ✓ Check edit steps
      ✓ Should pass DefaultInstanceLimits Step
      ✓ Should pass ScalingRules Step
      ✓ Should pass RecurringSchedules Step
      ✓ Should pass SpecificDates Step
      ✓ Should go to App Autoscaler Tab

    Autoscaler Edit Policy -
      ✓ Check edit steps
      ✓ Should pass DefaultInstanceLimits Step
      ✓ Should pass ScalingRules Step
      ✓ Should pass RecurringSchedules Step
      ✓ Should pass SpecificDates Step
      ✓ Should go to App Autoscaler Tab

    Autoscaler Metric Page -

      From autoscaler metric card
        ✓ Go to metric page
        ✓ Should go to App Autoscaler Tab

    Autoscaler Event Page -

      From autoscaler event card
        ✓ Go to events page
        ✓ Should go to App Autoscaler Tab

    Autoscaler Detach Policy -
      ✓ Cancel detach action
      ✓ Confirm detach action

@cfdreddbot
Copy link

✅ Hey zyjiaobj! The commit authors and yourself have already signed the CLA.

@zyjiaobj zyjiaobj self-assigned this Jun 26, 2019
@codecov
Copy link

codecov bot commented Jun 26, 2019

Codecov Report

Merging #3681 into v2-master will decrease coverage by <.01%.
The diff coverage is 70%.

@@              Coverage Diff              @@
##           v2-master    #3681      +/-   ##
=============================================
- Coverage      52.22%   52.21%   -0.01%     
=============================================
  Files            785      785              
  Lines          23010    23015       +5     
  Branches        4124     4125       +1     
=============================================
+ Hits           12017    12018       +1     
- Misses         10993    10997       +4

@zyjiaobj zyjiaobj force-pushed the autoscaler_e2e branch 2 times, most recently from 0e646e7 to 12271d7 Compare July 5, 2019 08:33
@zyjiaobj zyjiaobj force-pushed the autoscaler_e2e branch 5 times, most recently from d2506ed to d283c6f Compare July 26, 2019 10:17
Copy link
Contributor

@richard-cox richard-cox left a comment

Choose a reason for hiding this comment

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

  • I've moved common deploy code into a helper function and tested the non-autoscaler part. In the future we might drop this part and use the existing go-env app for autoscaler tests (the deploy step process can be brittle)
  • There's a number of e2e.sleep, we've tried to avoid these by using wait functions which should be available on most pages and components
  • I still need to come back and test autoscaler features (after polling change) and e2e tests

@zyjiaobj zyjiaobj force-pushed the autoscaler_e2e branch 2 times, most recently from 8b3bea4 to 1d0f8ba Compare August 13, 2019 02:41
@richard-cox
Copy link
Contributor

@zyjiaobj I've resolved merge conflicts and updated the PR with a few tweaks.

  • Timezone/Format issues
    • This was why the tests failed for me, there's a different format shown in my browser, along with a 24h time shown in date/time controls. I've updated the code to be more agnostic but it still depends on format strings. Is there any way these can be determined at test run time?
    • The form fill of date/time strings used a regex that would also need updating
  • The test for scaling events waits for 30 seconds, however in SCF there doesn't seem to be any events after this pause. I need to investigate if these do eventually come up

@zyjiaobj zyjiaobj force-pushed the autoscaler_e2e branch 2 times, most recently from 4901445 to 069e9b1 Compare August 21, 2019 01:42
Copy link
Contributor

@richard-cox richard-cox left a comment

Choose a reason for hiding this comment

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

Tested locally against an SCF with autoscaler enabled in eng cloud and everything passes fine. Once we've updated our travis SCF instance with autoscaler I'll bump this through the travis gates and get it merged.

@zyjiaobj zyjiaobj changed the base branch from v2-master to master November 13, 2019 06:59
- before.. the fetch policy request was used to determine if autoscaler was generally available, and thus had to differentiate no autoscaler and no policy
- this causes issues with a new structure of response
- now.. we don't need this extra code, the check if autoscaler is enabled happens higher up per cf and not per app
This reverts commit f26d9db.
This reverts commit 245facc.
This reverts commit b4753c1.
@richard-cox
Copy link
Contributor

Updated with some improvements from another PR, now blocked on #4035

richard-cox and others added 10 commits December 10, 2019 11:21
- create policy test sets a start time very close to current time (so it kicks off an autoscaling event)
- when edit policy test tries to sumbit same rule the start time can appear in the past, causing the edit requet to fail
- now we update the start time before editing. also then allow more time for scaling event to occurr
- Bring longer running `beforeAll`s into `it`s
- Use common code when available
- Remove some requirements to page load in `beforeEach`s
- Combine some tests
- Handle situation where quota no.s exceed page size
  - Search for quotas in tables
  - Remove some checks for pages to contain text (checks done in other functions)
@richard-cox richard-cox merged commit d998e5c into master Dec 12, 2019
@richard-cox richard-cox deleted the autoscaler_e2e branch December 12, 2019 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants