From e5a666fb13e2c89c299f9a1e2c50e2e0ba0d6451 Mon Sep 17 00:00:00 2001 From: Valery Bugakov Date: Tue, 9 May 2023 23:47:56 -0700 Subject: [PATCH] bazel: decouple web application bundle from integration tests modules (#51560) Make the web application bundle independent from the `//client/web/src/integration` and `//client/shared/src/testing`. It significantly slows down the Percy changes I iterate on locally. Previously they were connected via multiple mock files and the shared `isHotReloadEnabled` variable. The variable is redundant now, and the mock files are correctly moved to the `web_tests` target out of `web_lib`. --- .eslintignore | 1 + .prettierignore | 1 + client/BUILD.bazel | 2 ++ client/shared/BUILD.bazel | 1 - client/shared/src/search/integration/index.ts | 1 - client/vscode/tests/vsce.test.ts | 5 ++- client/web/BUILD.bazel | 34 +++++++++---------- client/web/src/components/WebStory.tsx | 2 +- ...xt.ts => legacyLayoutRouteContext.mock.ts} | 0 client/web/src/integration/BUILD.bazel | 1 - .../src/integration/code-monitoring.test.ts | 2 +- client/web/src/integration/environment.ts | 2 -- client/web/src/integration/nav.test.ts | 2 +- client/web/src/integration/notebook.test.ts | 5 ++- .../src/integration/search-contexts.test.ts | 5 ++- client/web/src/integration/search.test.ts | 2 +- .../team/area/TeamChildTeamsPage.story.tsx | 2 +- .../src/team/area/TeamMembersPage.story.tsx | 2 +- .../src/team/area/TeamProfilePage.story.tsx | 2 +- .../{test-utils.ts => testContext.mock.ts} | 0 client/web/webpack.bazel.config.js | 2 +- client/web/webpack.config.js | 2 +- 22 files changed, 42 insertions(+), 34 deletions(-) delete mode 100644 client/shared/src/search/integration/index.ts rename client/web/src/components/{legacyLayoutRouteContext.ts => legacyLayoutRouteContext.mock.ts} (100%) delete mode 100644 client/web/src/integration/environment.ts rename client/web/src/team/area/{test-utils.ts => testContext.mock.ts} (100%) diff --git a/.eslintignore b/.eslintignore index 53dae7ba10a..344a5b57163 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,3 +6,4 @@ GH2SG.bookmarklet.js svelte.config.js vite.config.ts playwright.config.ts +.vscode-test diff --git a/.prettierignore b/.prettierignore index c77437302d8..fc02cba9338 100644 --- a/.prettierignore +++ b/.prettierignore @@ -48,6 +48,7 @@ pnpm-lock.yaml node_modules/ client/web-sveltekit/.svelte-kit *.module.scss.d.ts +.vscode-test # Errors when used with @ianvs/prettier-plugin-sort-imports due to TS language API hitting global `eval` client/browser/src/types/webextension-polyfill/index.d.ts diff --git a/client/BUILD.bazel b/client/BUILD.bazel index bbf081ce73c..d6d210a73a8 100644 --- a/client/BUILD.bazel +++ b/client/BUILD.bazel @@ -7,11 +7,13 @@ # Test files, snapshots etc: # gazelle:js_test_files **/*.{spec,test}.{ts,tsx} # gazelle:js_test_files **/mock*.{ts,tsx} +# gazelle:js_test_files **/*.{mock,mocks}.{ts,tsx} # gazelle:js_test_files **/mocks/** # gazelle:js_test_files **/testutils/** # gazelle:js_test_files **/tests/** # gazelle:js_test_files **/__mocks__/**/*.{ts,tsx} # gazelle:js_test_files **/fixtures/**/*.{ts,tsx} +# gazelle:js_test_files **/WebStory.{ts,tsx} # TODO(bazel): put fixtures + testutils + ? into own rules # js_{fixture}_files **/*.{fixture,fixtures}.{ts,tsx} diff --git a/client/shared/BUILD.bazel b/client/shared/BUILD.bazel index 6f7726f8c94..f8a9bcbfe35 100644 --- a/client/shared/BUILD.bazel +++ b/client/shared/BUILD.bazel @@ -256,7 +256,6 @@ ts_project( "src/search/helpers/queryExample.ts", "src/search/helpers/searchContext.ts", "src/search/index.ts", - "src/search/integration/index.ts", "src/search/integration/streaming-search-mocks.ts", "src/search/query/analyze.ts", "src/search/query/completion.ts", diff --git a/client/shared/src/search/integration/index.ts b/client/shared/src/search/integration/index.ts deleted file mode 100644 index e2a265a5b8b..00000000000 --- a/client/shared/src/search/integration/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './streaming-search-mocks' diff --git a/client/vscode/tests/vsce.test.ts b/client/vscode/tests/vsce.test.ts index c9e03aca9cd..54fe7a501bf 100644 --- a/client/vscode/tests/vsce.test.ts +++ b/client/vscode/tests/vsce.test.ts @@ -1,6 +1,9 @@ import { downloadAndUnzipVSCode } from '@vscode/test-electron' -import { mixedSearchStreamEvents, highlightFileResult } from '@sourcegraph/shared/src/search/integration' +import { + mixedSearchStreamEvents, + highlightFileResult, +} from '@sourcegraph/shared/src/search/integration/streaming-search-mocks' import { Settings } from '@sourcegraph/shared/src/settings/settings' import { createVSCodeIntegrationTestContext, VSCodeIntegrationTestContext } from './context' diff --git a/client/web/BUILD.bazel b/client/web/BUILD.bazel index af999c5bf88..af16c1aaee7 100644 --- a/client/web/BUILD.bazel +++ b/client/web/BUILD.bazel @@ -173,7 +173,6 @@ ts_project( "src/code-monitoring/CodeMonitoringLogo.tsx", "src/codeMonitoring/index.ts", "src/codeintel/BrainDot.tsx", - "src/codeintel/ReferencesPanel.mocks.ts", "src/codeintel/ReferencesPanel.tsx", "src/codeintel/ReferencesPanelQueries.ts", "src/codeintel/index.ts", @@ -279,7 +278,6 @@ ts_project( "src/components/WebHoverOverlay/WebHoverOverlay.fixtures.ts", "src/components/WebHoverOverlay/WebHoverOverlay.tsx", "src/components/WebHoverOverlay/index.ts", - "src/components/WebStory.tsx", "src/components/branding/BrandLogo.tsx", "src/components/diff/DiffBoundary.tsx", "src/components/diff/DiffHunk.tsx", @@ -310,7 +308,6 @@ ts_project( "src/components/externalServices/index.ts", "src/components/fuzzyFinder/FuzzyActions.tsx", "src/components/fuzzyFinder/FuzzyFiles.tsx", - "src/components/fuzzyFinder/FuzzyFinder.mocks.tsx", "src/components/fuzzyFinder/FuzzyFinder.tsx", "src/components/fuzzyFinder/FuzzyFinderFeatureFlag.ts", "src/components/fuzzyFinder/FuzzyFsm.ts", @@ -329,7 +326,6 @@ ts_project( "src/components/gitHubApps/GitHubAppPage.tsx", "src/components/gitHubApps/GitHubAppsPage.tsx", "src/components/gitHubApps/backend.ts", - "src/components/legacyLayoutRouteContext.ts", "src/components/shared.tsx", "src/components/time/Duration.tsx", "src/components/useScrollToLocationHash.ts", @@ -354,7 +350,6 @@ ts_project( "src/enterprise/batches/backend.ts", "src/enterprise/batches/batch-spec/BatchSpecContext.tsx", "src/enterprise/batches/batch-spec/TabBar.tsx", - "src/enterprise/batches/batch-spec/batch-spec.mock.ts", "src/enterprise/batches/batch-spec/edit/DownloadSpecModal.tsx", "src/enterprise/batches/batch-spec/edit/EditBatchSpecPage.tsx", "src/enterprise/batches/batch-spec/edit/RunBatchSpecButton.tsx", @@ -424,7 +419,6 @@ ts_project( "src/enterprise/batches/detail/ActiveExecutionNotice.tsx", "src/enterprise/batches/detail/BatchChangeBurndownChart.tsx", "src/enterprise/batches/detail/BatchChangeDetailsActionSection.tsx", - "src/enterprise/batches/detail/BatchChangeDetailsPage.mock.ts", "src/enterprise/batches/detail/BatchChangeDetailsPage.tsx", "src/enterprise/batches/detail/BatchChangeDetailsTabs.tsx", "src/enterprise/batches/detail/BatchChangeStatsCard.tsx", @@ -437,7 +431,6 @@ ts_project( "src/enterprise/batches/detail/WebhookAlert.tsx", "src/enterprise/batches/detail/backend.ts", "src/enterprise/batches/detail/bulk-operations/BulkOperationNode.tsx", - "src/enterprise/batches/detail/changesets/BatchChangeChangesets.mock.ts", "src/enterprise/batches/detail/changesets/BatchChangeChangesets.tsx", "src/enterprise/batches/detail/changesets/BatchChangeChangesetsHeader.tsx", "src/enterprise/batches/detail/changesets/ChangesetCheckStatusCell.tsx", @@ -1051,7 +1044,6 @@ ts_project( "src/marketing/components/SurveyUseCaseForm.tsx", "src/marketing/components/TweetFeedback.tsx", "src/marketing/page/SurveyForm.tsx", - "src/marketing/page/SurveyPage.mocks.ts", "src/marketing/page/SurveyPage.tsx", "src/marketing/toast/SurveySuccessToast.tsx", "src/marketing/toast/SurveyToastContent.tsx", @@ -1076,7 +1068,6 @@ ts_project( "src/nav/NavBar/NavBar.tsx", "src/nav/NavBar/NavDropdown.tsx", "src/nav/NavBar/index.tsx", - "src/nav/StatusMessagesNavItem.mocks.ts", "src/nav/StatusMessagesNavItem.tsx", "src/nav/StatusMessagesNavItemQueries.ts", "src/nav/UserNavItem.tsx", @@ -1170,13 +1161,11 @@ ts_project( "src/repo/RepoRevisionSidebarFocusableTree.tsx", "src/repo/RepoRevisionSidebarSymbolTree.tsx", "src/repo/RepoRevisionSidebarSymbols.tsx", - "src/repo/RepositoriesPopover/RepositoriesPopover.mocks.ts", "src/repo/RepositoriesPopover/RepositoriesPopover.tsx", "src/repo/RepositoriesPopover/RepositoryNode.tsx", "src/repo/RepositoriesPopover/index.ts", "src/repo/RepositoryFileTreePage.tsx", "src/repo/RepositoryNotFoundPage.tsx", - "src/repo/RevisionsPopover/RevisionsPopover.mocks.ts", "src/repo/RevisionsPopover/RevisionsPopover.tsx", "src/repo/RevisionsPopover/RevisionsPopoverCommits.tsx", "src/repo/RevisionsPopover/RevisionsPopoverReferences.tsx", @@ -1346,7 +1335,6 @@ ts_project( "src/search/results/createActions.ts", "src/search/results/export/SearchResultsCsvExportModal.tsx", "src/search/results/export/searchResultsExport.ts", - "src/search/results/sidebar/Revisions.mocks.ts", "src/search/results/sidebar/Revisions.tsx", "src/search/results/sidebar/SearchAggregations.tsx", "src/search/results/sidebar/SearchFiltersSidebar.tsx", @@ -1546,7 +1534,6 @@ ts_project( "src/team/area/TeamMembersPage.tsx", "src/team/area/TeamProfilePage.tsx", "src/team/area/backend.ts", - "src/team/area/test-utils.ts", "src/team/backend.ts", "src/team/index.ts", "src/team/list/DeleteTeamModal.tsx", @@ -1713,7 +1700,7 @@ ts_project( "//:node_modules/focus-visible", "//:node_modules/fzf", "//:node_modules/graphiql", - "//:node_modules/graphql", + "//:node_modules/graphql", # keep "//:node_modules/history", "//:node_modules/http-status-codes", "//:node_modules/is-absolute-url", @@ -1748,10 +1735,8 @@ ts_project( "//:node_modules/use-resize-observer", "//:node_modules/utility-types", #keep "//:node_modules/uuid", - "//:node_modules/wildcard-mock-link", "//:node_modules/yaml-ast-parser", "//:node_modules/zustand", - "//client/shared:graphql_operations", "//schema:schema-json", ], ) @@ -1772,6 +1757,7 @@ ts_project( "src/auth/SignInPage.test.tsx", "src/auth/SignUpPage.test.tsx", "src/backend/persistenceMapper.test.ts", + "src/codeintel/ReferencesPanel.mocks.ts", "src/codeintel/ReferencesPanel.test.tsx", "src/components/ErrorBoundary.test.tsx", "src/components/FilteredConnection/FilteredConnection.test.tsx", @@ -1779,15 +1765,21 @@ ts_project( "src/components/FilteredConnection/hooks/useShowMorePagination.test.tsx", "src/components/KeyboardShortcutsHelp/KeyboardShortcutsHelp.test.tsx", "src/components/LoaderButton.test.tsx", + "src/components/WebStory.tsx", "src/components/branding/BrandLogo.test.tsx", "src/components/diff/DiffHunk.test.tsx", "src/components/diff/DiffSplitHunk.test.tsx", "src/components/diff/DiffStat.test.tsx", "src/components/externalServices/ExternalServiceForm.test.tsx", "src/components/externalServices/externalServices.test.tsx", + "src/components/fuzzyFinder/FuzzyFinder.mocks.tsx", "src/components/fuzzyFinder/FuzzyFinder.test.tsx", + "src/components/legacyLayoutRouteContext.mock.ts", "src/enterprise/batches/MultiSelectContext.test.tsx", + "src/enterprise/batches/batch-spec/batch-spec.mock.ts", "src/enterprise/batches/batch-spec/yaml-util.test.ts", + "src/enterprise/batches/detail/BatchChangeDetailsPage.mock.ts", + "src/enterprise/batches/detail/changesets/BatchChangeChangesets.mock.ts", "src/enterprise/code-monitoring/CodeMonitoringPage.test.tsx", "src/enterprise/code-monitoring/CreateCodeMonitorPage.test.tsx", "src/enterprise/code-monitoring/ManageCodeMonitorPage.test.tsx", @@ -1824,10 +1816,12 @@ ts_project( "src/hooks/useUrlSyncedState.test.ts", "src/hooks/useUrlSyncedString.test.tsx", "src/insights/utils/use-series-toggle.test.tsx", + "src/marketing/page/SurveyPage.mocks.ts", "src/marketing/page/SurveyPage.test.tsx", "src/marketing/toast/SurveyToast.test.tsx", "src/monitoring/shouldErrorBeReported.test.ts", "src/nav/GlobalNavbar.test.tsx", + "src/nav/StatusMessagesNavItem.mocks.ts", "src/nav/StatusMessagesNavItem.test.tsx", "src/nav/UserNavItem.test.tsx", "src/notebooks/serialize/convertMarkdownToBlocks.test.ts", @@ -1836,7 +1830,9 @@ ts_project( "src/open-in-editor/migrate-legacy-settings.test.ts", "src/person/PersonLink.test.tsx", "src/repo/RepoRevisionSidebarSymbols.test.tsx", + "src/repo/RepositoriesPopover/RepositoriesPopover.mocks.ts", "src/repo/RepositoriesPopover/RepositoriesPopover.test.tsx", + "src/repo/RevisionsPopover/RevisionsPopover.mocks.ts", "src/repo/RevisionsPopover/RevisionsPopover.test.tsx", "src/repo/blob/actions/ToggleRenderedFileMode.test.tsx", "src/repo/blob/codemirror/document-highlights.test.ts", @@ -1853,6 +1849,7 @@ ts_project( "src/search/results/SearchResultsInfoBar.test.tsx", "src/search/results/StreamingSearchResults.test.tsx", "src/search/results/export/searchResultsExport.test.ts", + "src/search/results/sidebar/Revisions.mocks.ts", "src/search/results/sidebar/Revisions.test.tsx", "src/site-admin/SiteAdminFeatureFlagsPage.test.ts", "src/site-admin/SiteAdminMigrationsPage.test.ts", @@ -1861,6 +1858,7 @@ ts_project( "src/site/LicenseExpirationAlert.test.tsx", "src/stores/navbarSearchQueryState.test.ts", "src/stores/notepad.test.ts", + "src/team/area/testContext.mock.ts", "src/tour/components/Tour/Tour.test.tsx", "src/tour/components/Tour/useTour.test.tsx", "src/tracking/util.test.ts", @@ -1902,6 +1900,7 @@ ts_project( "//:node_modules/ajv-formats", "//:node_modules/date-fns", "//:node_modules/delay", + "//:node_modules/graphql", "//:node_modules/history", "//:node_modules/lodash", "//:node_modules/react", @@ -1912,6 +1911,7 @@ ts_project( "//:node_modules/sinon", "//:node_modules/wildcard-mock-link", "//:node_modules/zustand", + "//client/shared:graphql_operations", ], ) @@ -1964,7 +1964,6 @@ WEBPACK_CONFIG_DEPS = [ "//:node_modules/webpack", "//:node_modules/react-refresh", "//client/web/dev", - "//client/web/src/integration", "//:node_modules/react-visibility-sensor", # required for https://github.com/joshwnj/react-visibility-sensor/issues/148 workaround # HACKS: bundle-time css import @@ -1993,6 +1992,7 @@ ENTERPRISE_BUNDLE_DATA_DEPS = BUNDLE_DATA_DEPS + [ "//:babel_config", "//:browserslist", "//:package_json", + ":web_lib", ], entry_points = { "src/main.js": "app", diff --git a/client/web/src/components/WebStory.tsx b/client/web/src/components/WebStory.tsx index b3942d10f58..26486030dec 100644 --- a/client/web/src/components/WebStory.tsx +++ b/client/web/src/components/WebStory.tsx @@ -13,7 +13,7 @@ import { SourcegraphContext } from '../jscontext' import { LegacyLayoutRouteContext, LegacyRouteContext } from '../LegacyRouteContext' import { BreadcrumbSetters, BreadcrumbsProps, useBreadcrumbs } from './Breadcrumbs' -import { legacyLayoutRouteContextMock } from './legacyLayoutRouteContext' +import { legacyLayoutRouteContextMock } from './legacyLayoutRouteContext.mock' import webStyles from '../SourcegraphWebApp.scss' diff --git a/client/web/src/components/legacyLayoutRouteContext.ts b/client/web/src/components/legacyLayoutRouteContext.mock.ts similarity index 100% rename from client/web/src/components/legacyLayoutRouteContext.ts rename to client/web/src/components/legacyLayoutRouteContext.mock.ts diff --git a/client/web/src/integration/BUILD.bazel b/client/web/src/integration/BUILD.bazel index 3a345f3bae3..19eac87add2 100644 --- a/client/web/src/integration/BUILD.bazel +++ b/client/web/src/integration/BUILD.bazel @@ -20,7 +20,6 @@ ts_project( name = "integration", srcs = [ "context.ts", - "environment.ts", "graphQlResponseHelpers.ts", "graphQlResults.ts", "insights/utils/override-insights-graphql-api.ts", diff --git a/client/web/src/integration/code-monitoring.test.ts b/client/web/src/integration/code-monitoring.test.ts index dee8be65f4e..ddaab87842b 100644 --- a/client/web/src/integration/code-monitoring.test.ts +++ b/client/web/src/integration/code-monitoring.test.ts @@ -2,7 +2,7 @@ import assert from 'assert' import expect from 'expect' -import { mixedSearchStreamEvents } from '@sourcegraph/shared/src/search/integration' +import { mixedSearchStreamEvents } from '@sourcegraph/shared/src/search/integration/streaming-search-mocks' import { accessibilityAudit } from '@sourcegraph/shared/src/testing/accessibility' import { Driver, createDriverForTest } from '@sourcegraph/shared/src/testing/driver' import { afterEachSaveScreenshotIfFailed } from '@sourcegraph/shared/src/testing/screenshotReporter' diff --git a/client/web/src/integration/environment.ts b/client/web/src/integration/environment.ts deleted file mode 100644 index 93de41f665a..00000000000 --- a/client/web/src/integration/environment.ts +++ /dev/null @@ -1,2 +0,0 @@ -// A shared variable to keep webpack.config and integration tests context configuration in sync. -export const isHotReloadEnabled = process.env.NODE_ENV !== 'production' && process.env.CI !== 'true' diff --git a/client/web/src/integration/nav.test.ts b/client/web/src/integration/nav.test.ts index 2728a0cf652..874f7e2464d 100644 --- a/client/web/src/integration/nav.test.ts +++ b/client/web/src/integration/nav.test.ts @@ -4,7 +4,7 @@ import { test } from 'mocha' import { encodeURIPathComponent } from '@sourcegraph/common' import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations' -import { mixedSearchStreamEvents } from '@sourcegraph/shared/src/search/integration' +import { mixedSearchStreamEvents } from '@sourcegraph/shared/src/search/integration/streaming-search-mocks' import { Driver, createDriverForTest } from '@sourcegraph/shared/src/testing/driver' import { afterEachSaveScreenshotIfFailed } from '@sourcegraph/shared/src/testing/screenshotReporter' diff --git a/client/web/src/integration/notebook.test.ts b/client/web/src/integration/notebook.test.ts index 8ca1832675d..3415bf2dff9 100644 --- a/client/web/src/integration/notebook.test.ts +++ b/client/web/src/integration/notebook.test.ts @@ -5,7 +5,10 @@ import { subDays } from 'date-fns' import expect from 'expect' import { SharedGraphQlOperations } from '@sourcegraph/shared/src/graphql-operations' -import { highlightFileResult, mixedSearchStreamEvents } from '@sourcegraph/shared/src/search/integration' +import { + highlightFileResult, + mixedSearchStreamEvents, +} from '@sourcegraph/shared/src/search/integration/streaming-search-mocks' import { SearchEvent } from '@sourcegraph/shared/src/search/stream' import { accessibilityAudit } from '@sourcegraph/shared/src/testing/accessibility' import { Driver, createDriverForTest } from '@sourcegraph/shared/src/testing/driver' diff --git a/client/web/src/integration/search-contexts.test.ts b/client/web/src/integration/search-contexts.test.ts index 555a9af93ef..d1c613b3d17 100644 --- a/client/web/src/integration/search-contexts.test.ts +++ b/client/web/src/integration/search-contexts.test.ts @@ -4,7 +4,10 @@ import { range } from 'lodash' import { test } from 'mocha' import { SharedGraphQlOperations, SearchContextMinimalFields } from '@sourcegraph/shared/src/graphql-operations' -import { highlightFileResult, mixedSearchStreamEvents } from '@sourcegraph/shared/src/search/integration' +import { + highlightFileResult, + mixedSearchStreamEvents, +} from '@sourcegraph/shared/src/search/integration/streaming-search-mocks' import { accessibilityAudit } from '@sourcegraph/shared/src/testing/accessibility' import { Driver, createDriverForTest } from '@sourcegraph/shared/src/testing/driver' import { afterEachSaveScreenshotIfFailed } from '@sourcegraph/shared/src/testing/screenshotReporter' diff --git a/client/web/src/integration/search.test.ts b/client/web/src/integration/search.test.ts index 193b2783661..1dfd5eb280a 100644 --- a/client/web/src/integration/search.test.ts +++ b/client/web/src/integration/search.test.ts @@ -12,7 +12,7 @@ import { highlightFileResult, symbolSearchStreamEvents, ownerSearchStreamEvents, -} from '@sourcegraph/shared/src/search/integration' +} from '@sourcegraph/shared/src/search/integration/streaming-search-mocks' import { SearchEvent } from '@sourcegraph/shared/src/search/stream' import { accessibilityAudit } from '@sourcegraph/shared/src/testing/accessibility' import { Driver, createDriverForTest } from '@sourcegraph/shared/src/testing/driver' diff --git a/client/web/src/team/area/TeamChildTeamsPage.story.tsx b/client/web/src/team/area/TeamChildTeamsPage.story.tsx index b64871fa280..4e68ba5dba9 100644 --- a/client/web/src/team/area/TeamChildTeamsPage.story.tsx +++ b/client/web/src/team/area/TeamChildTeamsPage.story.tsx @@ -8,7 +8,7 @@ import { ListTeamsOfParentResult } from '../../graphql-operations' import { LIST_TEAMS_OF_PARENT } from '../list/backend' import { TeamChildTeamsPage } from './TeamChildTeamsPage' -import { testContext } from './test-utils' +import { testContext } from './testContext.mock' const config: Meta = { title: 'web/teams/TeamChildTeamsPage', diff --git a/client/web/src/team/area/TeamMembersPage.story.tsx b/client/web/src/team/area/TeamMembersPage.story.tsx index b2416ca5220..89420daba42 100644 --- a/client/web/src/team/area/TeamMembersPage.story.tsx +++ b/client/web/src/team/area/TeamMembersPage.story.tsx @@ -8,7 +8,7 @@ import { ListTeamMembersResult } from '../../graphql-operations' import { LIST_TEAM_MEMBERS } from '../members/backend' import { TeamMembersPage } from './TeamMembersPage' -import { testContext } from './test-utils' +import { testContext } from './testContext.mock' const config: Meta = { title: 'web/teams/TeamMembersPage', diff --git a/client/web/src/team/area/TeamProfilePage.story.tsx b/client/web/src/team/area/TeamProfilePage.story.tsx index d12b71249f6..68b5beeacbf 100644 --- a/client/web/src/team/area/TeamProfilePage.story.tsx +++ b/client/web/src/team/area/TeamProfilePage.story.tsx @@ -3,7 +3,7 @@ import { Meta, Story } from '@storybook/react' import { WebStory } from '../../components/WebStory' import { TeamProfilePage } from './TeamProfilePage' -import { testContext } from './test-utils' +import { testContext } from './testContext.mock' const config: Meta = { title: 'web/teams/TeamProfilePage', diff --git a/client/web/src/team/area/test-utils.ts b/client/web/src/team/area/testContext.mock.ts similarity index 100% rename from client/web/src/team/area/test-utils.ts rename to client/web/src/team/area/testContext.mock.ts diff --git a/client/web/webpack.bazel.config.js b/client/web/webpack.bazel.config.js index 86d4997533a..56095147806 100644 --- a/client/web/webpack.bazel.config.js +++ b/client/web/webpack.bazel.config.js @@ -27,7 +27,6 @@ const { } = require('@sourcegraph/build-config') const { IS_PRODUCTION, IS_DEVELOPMENT, ENVIRONMENT_CONFIG, writeIndexHTMLPlugin } = require('./dev/utils') -const { isHotReloadEnabled } = require('./src/integration/environment') const { NODE_ENV, @@ -52,6 +51,7 @@ const { SENTRY_PROJECT, } = ENVIRONMENT_CONFIG +const isHotReloadEnabled = NODE_ENV !== 'production' && !IS_CI const IS_PERSISTENT_CACHE_ENABLED = false // Disabled in Bazel const IS_EMBED_ENTRY_POINT_ENABLED = ENTERPRISE && (IS_PRODUCTION || (IS_DEVELOPMENT && EMBED_DEVELOPMENT)) diff --git a/client/web/webpack.config.js b/client/web/webpack.config.js index 04e4c797a81..31740eedfae 100644 --- a/client/web/webpack.config.js +++ b/client/web/webpack.config.js @@ -29,7 +29,6 @@ const { } = require('@sourcegraph/build-config') const { IS_PRODUCTION, IS_DEVELOPMENT, ENVIRONMENT_CONFIG, writeIndexHTMLPlugin } = require('./dev/utils') -const { isHotReloadEnabled } = require('./src/integration/environment') const { NODE_ENV, @@ -55,6 +54,7 @@ const { SOURCEGRAPH_APP, } = ENVIRONMENT_CONFIG +const isHotReloadEnabled = NODE_ENV !== 'production' && !IS_CI const IS_PERSISTENT_CACHE_ENABLED = IS_DEVELOPMENT && !IS_CI const IS_EMBED_ENTRY_POINT_ENABLED = ENTERPRISE && (IS_PRODUCTION || (IS_DEVELOPMENT && EMBED_DEVELOPMENT))