Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .teamcity/_self/lib/wpcom/WPComPluginBuild.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ open class WPComPluginBuild(
-:pull*
""".trimIndent()
triggerRules = """
-:test/e2e/**.md
-:test/e2e/**
-:docs/**.md
-:comment=stress test:**
-:packages/calypso-e2e/**
""".trimIndent()
}
}
Expand Down
4 changes: 2 additions & 2 deletions .teamcity/_self/projects/WPComPlugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private object EditingToolkit : WPComPluginBuild(
name = "Run JS tests"
scriptContent = """
cd apps/editing-toolkit
yarn test:js --reporters=default --reporters=jest-teamcity --maxWorkers=${'$'}JEST_MAX_WORKERS
yarn test:js --reporters=default --reporters=jest-teamcity --maxWorkers=${'$'}JEST_E2E_WORKERS
"""
}
// Note: We run the PHP lint after the build to verify that the newspack-blocks
Expand Down Expand Up @@ -229,7 +229,7 @@ private object OdysseyStats : WPComPluginBuild(
cd apps/odyssey-stats

# run unit tests
yarn test:js --reporters=default --reporters=jest-teamcity --maxWorkers=${'$'}JEST_MAX_WORKERS
yarn test:js --reporters=default --reporters=jest-teamcity --maxWorkers=${'$'}JEST_E2E_WORKERS
"""
}
bashNodeScript {
Expand Down
148 changes: 0 additions & 148 deletions .teamcity/_self/projects/WebApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ object WebApp : Project({
buildType(playwrightPrBuildType("mobile", "90fbd6b7-fddb-4668-9ed0-b32598143616"))
buildType(PreReleaseE2ETests)
buildType(AuthenticationE2ETests)
buildType(HelpCentreE2ETests)
buildType(QuarantinedE2ETests)
})

Expand Down Expand Up @@ -982,153 +981,6 @@ object AuthenticationE2ETests : E2EBuildType(
}
)

object HelpCentreE2ETests : E2EBuildType(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These configurations were never used or no longer used.

buildId = "calypso_WebApp_Calypso_E2E_Help_Centre",
buildUuid = "a0e62582-8598-483e-8b82-9de540288f6d",
buildName = "Help Centre E2E Tests",
buildDescription = "Runs a suite of Help Centre E2E tests.",
testGroup = "help-centre",
buildParams = {
param("env.VIEWPORT_NAME", "desktop")
},
buildFeatures = {
notifications {
notifierSettings = slackNotifier {
connection = "PROJECT_EXT_11"
sendTo = "#e2eflowtesting-notif"
messageFormat = verboseMessageFormat {
addStatusText = true
}
}
branchFilter = "+:<default>"
buildFailedToStart = true
buildFailed = true
buildFinishedSuccessfully = false
buildProbablyHanging = true
}
},
buildTriggers = {
schedule {
schedulingPolicy = cron {
hours = "*/3"
}
branchFilter = "+:<default>"
triggerBuild = always()
withPendingChangesOnly = false
}
}
)

object KPIDashboardTests : BuildType({
id("calypso_WebApp_Calypso_E2E_KPI_Dashboard")
uuid = "441efac5-721a-4557-9448-9234e89fb6b1"
name = "Test build for KPI Dashboard project"
description = "Test build configuration for KPI dashboard."
artifactRules = """
logs.tgz => logs.tgz
screenshots => screenshots
trace => trace
allure-results.tgz => allure-results.tgz
""".trimIndent()

vcs {
root(Settings.WpCalypso)
cleanCheckout = true
}

params {
param("env.NODE_CONFIG_ENV", "test")
param("env.PLAYWRIGHT_BROWSERS_PATH", "0")
param("env.TEAMCITY_VERSION", "2021")
param("env.HEADLESS", "true")
param("env.LOCALE", "en")
param("env.DEBUG", "")
param("env.VIEWPORT_NAME", "desktop")
param("env.ALLURE_RESULTS_PATH", "allure-results")
}

steps {
bashNodeScript {
name = "Prepare environment"
scriptContent = """
# Install deps
yarn workspaces focus wp-e2e-tests @automattic/calypso-e2e

# Decrypt secrets
# Must do before build so the secrets are in the dist output
E2E_SECRETS_KEY="%E2E_SECRETS_ENCRYPTION_KEY_CURRENT%" yarn workspace @automattic/calypso-e2e decrypt-secrets

# Build packages
yarn workspace @automattic/calypso-e2e build
""".trimIndent()
dockerImage = "%docker_image_e2e%"
}

bashNodeScript {
name = "Run tests"
scriptContent = """
# Configure bash shell.
shopt -s globstar
set -x

# Enter testing directory.
cd test/e2e
mkdir temp

# Run suite.
xvfb-run yarn jest --reporters=jest-teamcity --reporters=default --maxWorkers=%JEST_E2E_WORKERS% --group=kpi
"""
dockerImage = "%docker_image_e2e%"
}

bashNodeScript {
name = "Collect results"
executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE
scriptContent = """
set -x

mkdir -p screenshots
find test/e2e/results -type f \( -iname \*.webm -o -iname \*.png \) -print0 | xargs -r -0 mv -t screenshots

mkdir -p logs
find test/e2e/results -name '*.log' -print0 | xargs -r -0 tar cvfz logs.tgz

mkdir -p trace
find test/e2e/results -name '*.zip' -print0 | xargs -r -0 mv -t trace

mkdir -p allure-results
find test/e2e/allure-results -name '*.json' -print0 | xargs -r -0 tar cvfz allure-results.tgz
""".trimIndent()
dockerImage = "%docker_image_e2e%"
}
}

features {
perfmon {
}
}

// By default, no triggers are defined for this template class.
triggers {}

failureConditions {
executionTimeoutMin = 20
// Don't fail if the runner exists with a non zero code. This allows a build to pass if the failed tests have been muted previously.
nonZeroExitCode = false

// Fail if the number of passing tests is 50% or less than the last build. This will catch the case where the test runner crashes and no tests are run.
failOnMetricChange {
metric = BuildFailureOnMetric.MetricType.PASSED_TEST_COUNT
threshold = 50
units = BuildFailureOnMetric.MetricUnit.PERCENTS
comparison = BuildFailureOnMetric.MetricComparison.LESS
compareTo = build {
buildRule = lastSuccessful()
}
}
}
})

object QuarantinedE2ETests: E2EBuildType(
buildId = "calypso_WebApp_Quarantined_E2E_Tests",
buildUuid = "14083675-b6de-419f-b2f6-ec89c06d3a8c",
Expand Down
6 changes: 2 additions & 4 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ project {
// as supported (even though both TeamCity and chalk support that.)
param("env.FORCE_COLOR", "1")
param("env.NODE_OPTIONS", "--max-old-space-size=32000")
text("JEST_E2E_WORKERS", "100%", label = "Magellan parallel workers", description = "Number of parallel workers in Magellan (e2e tests)", allowEmpty = true)
text("env.JEST_MAX_WORKERS", "16", label = "Jest max workers", description = "How many tests run in parallel", allowEmpty = true)
text("JEST_E2E_WORKERS", "100%", label = "Jest max workers", description = "Number or percent of cores to use when running E2E tests.", allowEmpty = true)
password("matticbot_oauth_token", "credentialsJSON:34cb38a5-9124-41c4-8497-74ed6289d751", display = ParameterDisplay.HIDDEN)
text("env.CHILD_CONCURRENCY", "15", label = "Yarn child concurrency", description = "How many packages yarn builds in parallel", allowEmpty = true)
text("docker_image", "registry.a8c.com/calypso/base:latest", label = "Docker image", description = "Default Docker image used to run builds", allowEmpty = true)
Expand All @@ -81,9 +80,8 @@ project {
param("teamcity.git.fetchAllHeads", "true")

// e2e config decryption key references. See PCYsg-vnR-p2 for more info.
password("E2E_SECRETS_ENCRYPTION_KEY_NOV_30_22", "credentialsJSON:d9abde26-f565-4d21-bdf3-e2e00d3e45ec", display = ParameterDisplay.HIDDEN)
password("E2E_SECRETS_ENCRYPTION_KEY_JAN_20_23", "credentialsJSON:873582a4-c421-4647-b901-56c86abf09c8", display = ParameterDisplay.HIDDEN)
password("E2E_SECRETS_ENCRYPTION_KEY_JUN_27_23", "credentialsJSON:7f7a0165-754f-4a52-93ef-c97852cd83e0", display = ParameterDisplay.HIDDEN)
// Define the currently used encryption key here. This allows easy swapping between previously used keys.
password("E2E_SECRETS_ENCRYPTION_KEY_CURRENT", "%E2E_SECRETS_ENCRYPTION_KEY_JUN_27_23%", display = ParameterDisplay.HIDDEN)

// Calypso dashboard AWS secrets for S3 bucket.
Expand Down