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

bazel: decouple web application bundle from integration tests modules #51560

Merged
merged 3 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ GH2SG.bookmarklet.js
svelte.config.js
vite.config.ts
playwright.config.ts
.vscode-test
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions client/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion client/shared/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion client/shared/src/search/integration/index.ts

This file was deleted.

5 changes: 4 additions & 1 deletion client/vscode/tests/vsce.test.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
34 changes: 17 additions & 17 deletions client/web/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/web/src/components/WebStory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
1 change: 0 additions & 1 deletion client/web/src/integration/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/web/src/integration/code-monitoring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 0 additions & 2 deletions client/web/src/integration/environment.ts

This file was deleted.

2 changes: 1 addition & 1 deletion client/web/src/integration/nav.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
5 changes: 4 additions & 1 deletion client/web/src/integration/notebook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 4 additions & 1 deletion client/web/src/integration/search-contexts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion client/web/src/integration/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion client/web/src/team/area/TeamChildTeamsPage.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion client/web/src/team/area/TeamMembersPage.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion client/web/src/team/area/TeamProfilePage.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion client/web/webpack.bazel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion client/web/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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))

Expand Down