Skip to content

Commit

Permalink
Revert "improve typescript usage when appending experimental retry op…
Browse files Browse the repository at this point in the history
…tions to experiments in Experimenets.vue"

This reverts commit b459aba.
  • Loading branch information
cacieprins committed Oct 23, 2023
1 parent b459aba commit 9c54013
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
33 changes: 13 additions & 20 deletions packages/app/src/settings/project/Experiments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import SettingsSection from '../SettingsSection.vue'
import ExternalLink from '@cy/gql-components/ExternalLink.vue'
import type { ExperimentsFragment } from '../../generated/graphql'
import { useI18n } from '@cy/i18n'
import type { CypressResolvedConfig, CypressConfigEntry } from './projectSettings'
import type { CypressResolvedConfig } from './projectSettings'
const { t } = useI18n()
gql`
Expand All @@ -55,31 +55,24 @@ const props = defineProps<{
const localExperiments = computed(() => {
// get experiments out of the config
const cfg = (props.gql?.config || []) as CypressResolvedConfig
const experimentalConfigurations = cfg.filter((item) => item.field.startsWith('experimental'))
const experimentalConfigurations = props.gql?.config ? (props.gql.config as CypressResolvedConfig).filter((item) => item.field.startsWith('experimental')) : []
// get experimental retry properties on the 'retries' config object. Mutate the experimentalConfigurations array as to not have side effects with props.gql.config
// TODO: remove this once experimentalRetries becomes GA. This is to be treated as a one off as supported nested experiments inside config is rare.
// const { value: { experimentalStrategy, experimentalOptions, from } }
const retryConfig = cfg.find((item) => item.field === 'retries')
if (retryConfig) {
const { value: { experimentalStrategy, experimentalOptions, from } } = retryConfig as CypressConfigEntry & { value: Record<string, string> }
const { value: { experimentalStrategy, experimentalOptions, from } } = props.gql?.config.find((item) => item.field === 'retries')
experimentalConfigurations.push({
field: 'retries.experimentalStrategy',
from,
value: experimentalStrategy,
})
experimentalConfigurations.push({
field: 'retries.experimentalStrategy',
from,
value: experimentalStrategy,
})
experimentalConfigurations.push({
field: 'retries.experimentalOptions',
from,
value: experimentalOptions,
})
experimentalConfigurations.push({
field: 'retries.experimentalOptions',
from,
value: experimentalOptions,
})
// end TODO removal
}
return experimentalConfigurations.map((configItem) => {
return {
Expand Down
6 changes: 2 additions & 4 deletions packages/app/src/settings/project/projectSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ export interface Experiment {
key: string
}

export type CypressConfigEntry = {
export type CypressResolvedConfig = Array<{
field: string
from: 'default'| 'config' | 'plugin' | 'env'
value: string | number | boolean | Record<string, string> | Array<string>
}

export type CypressResolvedConfig = Array<CypressConfigEntry>
}>

5 comments on commit 9c54013

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9c54013 Oct 23, 2023

Choose a reason for hiding this comment

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

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.4.0/linux-arm64/feature/experimental-retries-9c540138c0ae49c0c23743bd7f62aef92ae529bb/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9c54013 Oct 23, 2023

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.4.0/linux-x64/feature/experimental-retries-9c540138c0ae49c0c23743bd7f62aef92ae529bb/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9c54013 Oct 23, 2023

Choose a reason for hiding this comment

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

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.4.0/darwin-x64/feature/experimental-retries-9c540138c0ae49c0c23743bd7f62aef92ae529bb/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9c54013 Oct 23, 2023

Choose a reason for hiding this comment

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

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.4.0/darwin-arm64/feature/experimental-retries-9c540138c0ae49c0c23743bd7f62aef92ae529bb/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9c54013 Oct 23, 2023

Choose a reason for hiding this comment

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

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.4.0/win32-x64/feature/experimental-retries-9c540138c0ae49c0c23743bd7f62aef92ae529bb/cypress.tgz

Please sign in to comment.