Skip to content

Commit

Permalink
Merge branch 'linode:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
cpathipa authored Sep 13, 2024
2 parents 342fd96 + 8a540c3 commit bfed239
Show file tree
Hide file tree
Showing 212 changed files with 4,631 additions and 1,561 deletions.
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,7 @@ packages/manager/test-report.xml
**/manager/cypress/videos/
**/manager/cypress/downloads/
**/manager/cypress/results/

# ignore all screenshots except records
# we ignore the png files, not the whole folder recursively
# or the record files are ignored too
**/manager/cypress/screenshots/**/*.png
!**/manager/cypress/screenshots/**/record*.png
**/manager/cypress/screenshots/

packages/manager/cypress/fixtures/example.json

Expand All @@ -142,4 +137,4 @@ packages/manager/bundle_analyzer_report.html
**/manager/src/dev-tools/*.local.*

# vitepress
docs/.vitepress/cache
docs/.vitepress/cache
3 changes: 3 additions & 0 deletions Jenkinsfile-component-tests.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
library 'ui-builder'

testManagerComponents()
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ x-e2e-env:
CY_TEST_SPLIT_RUN_TOTAL: ${CY_TEST_SPLIT_RUN_TOTAL}
CY_TEST_SPLIT_RUN_INDEX: ${CY_TEST_SPLIT_RUN_INDEX}

# Cypress performance.
CY_TEST_ACCOUNT_CACHE_DIR: ${CY_TEST_ACCOUNT_CACHE_DIR}

# Cypress reporting.
CY_TEST_JUNIT_REPORT: ${CY_TEST_JUNIT_REPORT}
CY_TEST_USER_REPORT: ${CY_TEST_USER_REPORT}
Expand All @@ -63,6 +66,7 @@ x-e2e-env:
x-e2e-volumes:
&default-volumes
- ./.git:/home/node/app/.git
- ./cache:/home/node/app/cache
- ./packages/manager:/home/node/app/packages/manager
- ./packages/validation:/home/node/app/packages/validation
- ./packages/api-v4:/home/node/app/packages/api-v4
Expand All @@ -83,6 +87,8 @@ x-e2e-runners:
condition: service_healthy
env_file: ./packages/manager/.env
volumes: *default-volumes
# TODO Stop using entrypoint, use CMD instead.
# (Or just make `yarn` the entrypoint, but either way stop forcing `cy:e2e`).
entrypoint: ['yarn', 'cy:e2e']

services:
Expand Down Expand Up @@ -114,6 +120,16 @@ services:
<<: *default-env
MANAGER_OAUTH: ${MANAGER_OAUTH}

# Component test runner.
# Does not require any Cloud Manager environment to run.
component:
<<: *default-runner
depends_on: []
environment:
CY_TEST_DISABLE_RETRIES: ${CY_TEST_DISABLE_RETRIES}
CY_TEST_JUNIT_REPORT: ${CY_TEST_JUNIT_REPORT}
entrypoint: ['yarn', 'cy:component:run']

# End-to-end test runner for Cloud's synthetic monitoring tests.
# Configured to run against a remote Cloud instance hosted at some URL.
e2e_heimdall:
Expand Down
8 changes: 8 additions & 0 deletions docs/development-guide/08-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ Environment variables related to Cypress logging and reporting, as well as repor
| `CY_TEST_FAIL_ON_MANAGED` | Fail affected tests when Managed is enabled | `1` | Unset; disabled by default |
| `CY_TEST_GENWEIGHTS` | Generate and output test weights to the given path | `./weights.json` | Unset; disabled by default |
###### Performance
Environment variables that can be used to improve test performance in some scenarios.
| Environment Variable | Description | Example | Default |
|---------------------------------|-----------------------------------------------|--------------------|----------------------------|
| `CY_TEST_ACCOUNT_CACHE_DIR` | Directory containing test account cache data | `./cache/accounts` | Unset; disabled by default |
### Writing End-to-End Tests
1. Look here for [Cypress Best Practices](https://docs.cypress.io/guides/references/best-practices)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"cy:ci": "yarn cy:e2e",
"cy:debug": "yarn workspace linode-manager cy:debug",
"cy:component": "yarn workspace linode-manager cy:component",
"cy:component:run": "yarn workspace linode-manager cy:component:run",
"cy:rec-snap": "yarn workspace linode-manager cy:rec-snap",
"changeset": "node scripts/changelog/changeset.mjs",
"generate-changelogs": "node scripts/changelog/generate-changelogs.mjs",
Expand Down
5 changes: 5 additions & 0 deletions packages/api-v4/.changeset/pr-10920-added-1726070878408.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/api-v4": Added
---

LinodeCapabilities type used for `capabilities` property of Linode interface ([#10920](https://github.com/linode/manager/pull/10920))
4 changes: 3 additions & 1 deletion packages/api-v4/src/linodes/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface Linode {
id: number;
alerts: LinodeAlerts;
backups: LinodeBackups;
capabilities?: string[]; // @TODO BSE: Remove optionality once BSE is fully rolled out
capabilities?: LinodeCapabilities[]; // @TODO BSE: Remove optionality once BSE is fully rolled out
created: string;
disk_encryption?: EncryptionStatus; // @TODO LDE: Remove optionality once LDE is fully rolled out
region: string;
Expand Down Expand Up @@ -54,6 +54,8 @@ export interface LinodeBackups {
last_successful: string | null;
}

export type LinodeCapabilities = 'Block Storage Encryption';

export type Window =
| 'Scheduling'
| 'W0'
Expand Down
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10825-tests-1724428903440.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Add tests for NodeBalancer Create flow ([#10825](https://github.com/linode/manager/pull/10825))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10852-tests-1724937535185.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Add new tests for for selecting "All" Scopes ([#10852](https://github.com/linode/manager/pull/10852))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10859-added-1725550540714.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Added
---

Gravatar sunset banner for existing Gravatar users ([#10859](https://github.com/linode/manager/pull/10859))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10859-changed-1725550568902.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Changed
---

Avatars for users without Gravatars ([#10859](https://github.com/linode/manager/pull/10859))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10867-tests-1725460656929.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Add `CY_TEST_ACCOUNT_CACHE_DIR` environment variable to enable retrieval of test account cache data ([#10867](https://github.com/linode/manager/pull/10867))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10867-tests-1725482924721.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Allow tests to fall back on cached account data when API request fails ([#10867](https://github.com/linode/manager/pull/10867))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Add conditional client library update required reboot notice to Volume Create page ([#10868](https://github.com/linode/manager/pull/10868))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tech Stories
---

Resolve "Incomplete string escape or encoding" codeQL alert in `generate-ansibleConfig.ts` ([#10887](https://github.com/linode/manager/pull/10887))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10889-tests-1725485099504.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Update remaining Linode Create Cypress tests run against Linode Create v2 ([#10889](https://github.com/linode/manager/pull/10889))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10892-tests-1725546783401.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Clean up feature flag mocks ([#10892](https://github.com/linode/manager/pull/10892))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10895-fixed-1725556985673.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Typo with toast success notification when updating Reverse DNS ([#10895](https://github.com/linode/manager/pull/10895))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10895-tests-1725557096432.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Add cypress test to confirm toast when updating RDNS, add unit tests for RDNS drawers ([#10895](https://github.com/linode/manager/pull/10895))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10899-changed-1725595024930.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Changed
---

Lower Events historical data fetching to 7 days ([#10899](https://github.com/linode/manager/pull/10899))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10904-added-1725873382370.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Added
---

DisplayPrice Story ([#10904](https://github.com/linode/manager/pull/10904))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10905-added-1725893781288.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Added
---

CheckoutSummary Story in Storybook ([#10905](https://github.com/linode/manager/pull/10905))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10907-tests-1725898460559.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Cypress integration test for Object Storage Gen2: E1 Endpoint ([#10907](https://github.com/linode/manager/pull/10907))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10909-tests-1725903174019.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Add unit tests for AttachVolumeDrawer component ([#10909](https://github.com/linode/manager/pull/10909))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Add 'Encrypt Volume' checkbox in Attach Volume drawer ([#10909](https://github.com/linode/manager/pull/10909))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10910-changed-1725910840891.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Changed
---

"contact support" links to new support ticket in event messages ([#10910](https://github.com/linode/manager/pull/10910))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10911-tests-1725912717549.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Add unit tests for NodeBalancersLanding package ([#10911](https://github.com/linode/manager/pull/10911))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10912-added-1725913446437.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Added
---

CopyableTextField story and clean up components ([#10912](https://github.com/linode/manager/pull/10912))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10913-fixed-1725955539025.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

DisplayPrice story crash when Currency component's minimumFractionDigits is negative ([#10913](https://github.com/linode/manager/pull/10913))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10914-fixed-1725988850881.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Linode Create v2 not handling deprecated and EOL Images ([#10914](https://github.com/linode/manager/pull/10914))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10915-tests-1725992312603.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Tag cypress tests by adding the "method:e2e" and "purpose:dcTesting" ([#10915](https://github.com/linode/manager/pull/10915))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10918-fixed-1726068911721.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

API Tokens Table Style Regression ([#10918](https://github.com/linode/manager/pull/10918))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Update BSE capability for Linodes to be `Block Storage Encryption` instead of `blockstorage_encryption` ([#10920](https://github.com/linode/manager/pull/10920))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tech Stories
---

Remove `linodeCreateRefactor` feature flag ([#10921](https://github.com/linode/manager/pull/10921))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10923-fixed-1726086511137.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Incorrect avatar displaying in Notification Center for a small subset of events ([#10923](https://github.com/linode/manager/pull/10923))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10926-tests-1726156342482.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Support running component tests via CI ([#10926](https://github.com/linode/manager/pull/10926))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10928-removed-1726148104546.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Changed
---

Invalid Tax Id Notification ([#10928](https://github.com/linode/manager/pull/10928))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Fix 'Create Volume' button state on Volume Create page when 'Encrypt Volume' checkbox is checked ([#10929](https://github.com/linode/manager/pull/10929))
10 changes: 9 additions & 1 deletion packages/manager/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ export default defineConfig({
specPattern: './cypress/component/**/*.spec.tsx',
viewportWidth: 500,
viewportHeight: 500,

setupNodeEvents(on, config) {
return setupPlugins(on, config, [
loadEnvironmentConfig,
discardPassedTestRecordings,
enableJunitReport('Component', true),
]);
},
},

e2e: {
Expand Down Expand Up @@ -85,7 +93,7 @@ export default defineConfig({
regionOverrideCheck,
logTestTagInfo,
splitCypressRun,
enableJunitReport,
enableJunitReport(),
generateTestWeights,
]);
},
Expand Down
6 changes: 3 additions & 3 deletions packages/manager/cypress/component/poc/region-select.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ componentTests('RegionSelect', (mount) => {
.should('be.visible');
});
regionsWithoutObj.forEach((region) => {
ui.autocompletePopper
.findByTitle(`${region.label} (${region.id})`)
.should('not.exist');
ui.autocompletePopper.find().within(() => {
cy.findByText(`${region.label} (${region.id})`).should('not.exist');
});
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ui } from 'support/ui';

describe('Logout Test', () => {
beforeEach(() => {
cy.tag('purpose:syntheticTesting');
cy.tag('purpose:syntheticTesting', 'method:e2e');
});

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ describe('Personal access tokens', () => {
* - Confirms that user is shown the token secret upon successful PAT creation
* - Confirms that new personal access token is shown in list
* - Confirms that user can open and close "View Scopes" drawer
* - Confirm that the “Child account access” grant is not visible in the list of permissions.
* - Upon clicking “Create Token”, assert that the outgoing API request payload contains "scopes" value as defined in token.
*/
it('can create personal access tokens', () => {
const token = appTokenFactory.build({
Expand Down Expand Up @@ -63,6 +65,9 @@ describe('Personal access tokens', () => {
.findByTitle('Add Personal Access Token')
.should('be.visible')
.within(() => {
// Confirm that the “Child account access” grant is not visible in the list of permissions.
cy.findAllByText('Child Account Access').should('not.exist');

// Confirm submit button is disabled without specifying scopes.
ui.buttonGroup
.findButtonByTitle('Create Token')
Expand Down Expand Up @@ -147,7 +152,12 @@ describe('Personal access tokens', () => {
});

// Confirm that new PAT is shown in list and "View Scopes" drawer works.
cy.wait('@getTokens');
// Upon clicking “Create Token”, assert that the outgoing API request payload contains "scopes" value as defined in token.
cy.wait('@getTokens').then((xhr) => {
const actualTokenData = xhr.response?.body.data;
const actualTokenScopes = actualTokenData[0].scopes;
expect(actualTokenScopes).to.equal(token.scopes);
});
cy.findByText(token.label)
.should('be.visible')
.closest('tr')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ describe('Account service transfers', () => {
* - Confirms user can navigate to service transfer page via user menu.
*/
it('can navigate to service transfers landing page', () => {
cy.tag('method:e2e');
cy.visitWithLogin('/');
cy.findByLabelText('Profile & Account').should('be.visible').click();

Expand Down Expand Up @@ -244,6 +245,7 @@ describe('Account service transfers', () => {
* - Confirms that users can cancel a service transfer
*/
it('can initiate and cancel a service transfer', () => {
cy.tag('method:e2e');
// Create a Linode to transfer.
const setupLinode = async (): Promise<Linode> => {
const payload = createLinodeRequestFactory.build({
Expand Down
Loading

0 comments on commit bfed239

Please sign in to comment.