Commit Graph

13 Commits

Author SHA1 Message Date
Quinn Slack
4002774429
reapply "switch from jest to vitest for faster, simpler tests (#57886)" (#58145)
* reapply "switch from jest to vitest for faster, simpler tests (https://github.com/sourcegraph/sourcegraph/pull/57886)"

This was reverted in https://github.com/sourcegraph/sourcegraph/pull/58116 due to an issue with the browser tests.

* include fetch-mock

* fix flakiness

* rm mock that did not work in experimentalVmThreads

* fix

* timeout

* fixup

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2023-11-07 12:00:18 +02:00
William Bezuidenhout
7f4bebe29d
Revert: bazel+vitest - when running vitests concurrently the target //client/browser:test fails (#58116)
When running vitests concurrently the target //client/browser:test fails

Revert "switch from jest to vitest for faster, simpler tests (#57886)"

This reverts commit ae5325e432.
2023-11-06 14:02:35 +02:00
Quinn Slack
ae5325e432
switch from jest to vitest for faster, simpler tests (#57886)
Replaces our usage of jest with vitest. Also removes the babel transpiler. This simplifies our test configuration by a lot, makes tests run 10% faster, and makes further modernizations to our build/test stuff possible (such as using vite for frontend builds).

This removes some of the junit exporting for Buildkite, and the vitest bazel defs don't really cleanly implement bazel testing guidelines (like sharding). But vitest is only used for unit tests (all integration/e2e/regression tests have always run in mocha), so none of them are very slow anyway.

## Codemods for vitest imports

fastmod -e js,ts,tsx @jest/globals vitest client/ dev/release/
fastmod -e js,ts,tsx 'jest\.(\w+)\(' 'vi.$1(' client/ dev/release/
fastmod -e js,ts,tsx 'jest,' 'vi,' client/ dev/release/
fastmod -e js,ts,tsx 'jest }' 'vi }' client/ dev/release/
git diff --diff-filter=M --name-only | xargs pnpm exec prettier --write
2023-11-05 21:57:04 -10:00
Greg Magolan
7f4e6da8cc
build: still need BAZEL_BINDIR for webpack_bundle custom rule (#48796)
Actually, webpack_bundle doesn't have JS_BINARY__TARGET set since it is
a custom build rule.... To handle all the cases I think we have to check
for both. 😞
2023-03-07 20:02:11 -08:00
Greg Magolan
edf5013405
build: use JS_BINARY__TARGET instead of BAZEL_BINDIR (#48795)
`BAZEL_BINDIR` is set for build targets only while `JS_BINARY__TARGET`
should be set for all js_binary & js_test targets for bazel build, test
& run contexts.
2023-03-07 06:04:50 +00:00
Jason Bedard
10aefc4bb7
bazel: add bazel build,tests for client/* (#46193)
Webpack bundles compile but need further testing. Jest + mocha tests
compile but are marked as `manual` until further work is done to get them
passing. The four jest tests are green and enabled now, though.

## Test plan

`bazel build //client/...` and `bazel test //client/...`
2023-02-28 20:46:03 -08:00
Robert Lin
63de6a4ab7
Revert "regression-tests: update custom mocha reporter to exit rather… (#41542)
Revert "regression-tests: update custom mocha reporter to exit rather than mocha itself (#41266)"

This reverts commit 3b31a19dcb.

This change's build's QA test timed out (https://buildkite.com/sourcegraph/sourcegraph/builds/172014#01831e2c-78c0-4046-8270-b3a8f5d48a90), the previous build aa2c9830f1 did not. The QA build hanging is causing all builds in main to fail after timing out.
2022-09-08 19:48:01 +00:00
William Bezuidenhout
3b31a19dcb
regression-tests: update custom mocha reporter to exit rather than mocha itself (#41266)
* update custom mocha reporter to be more robust

- ensure all files reference by mocha and mocha reporter are relative to
  repo root
- remove `--exit` from `yarn run test:regression`. The same
  functionality is now done by the customMochaSpecReporter with
  `process.exit(1)`
- some quality of life things in the qa test runner script

* Update client/shared/dev/customMochaSpecReporter.js

Co-authored-by: Valery Bugakov <skymk1@gmail.com>

* Update client/shared/dev/customMochaSpecReporter.js

Co-authored-by: Valery Bugakov <skymk1@gmail.com>

* prettier things

* use filenames in annotation

Co-authored-by: Valery Bugakov <skymk1@gmail.com>
2022-09-08 16:16:33 +00:00
William Bezuidenhout
91366db15f
use custom mocha reporter to generate annotations (#40438)
* initial commit of test reporter

* better use of annotated cmd

Co-authored-by: Valery Bugakov <skymk1@gmail.com>

* review comments and add additional comments describing approach

* rename reporter.js to something more descriptive

* restore files changed for debugging

* make eslint and prettier happy

Co-authored-by: Valery Bugakov <skymk1@gmail.com>
2022-08-18 16:16:13 +02:00
Valery Bugakov
0ffa954b83
web: mute Polly.js error logging on CI (#38406) 2022-07-11 01:24:53 -07:00
Valery Bugakov
96994c8cd8
web: make web integration tests great again! (#25027)
* test-integration

* test-integration

* web: update naming convention for constants

Co-authored-by: Jean Hadrien Chabran <jh@chabran.fr>

* web: update naming convention for constants

* Update enterprise/dev/ci/internal/ci/pipeline-steps.go

Co-authored-by: Tom Ross <tom@umpox.com>

* web: dont skip git clone step in test agents

* web: update web integration splitting logic

* web: update percy executable

* web: update executable path for storyshots

* web: download browser in async pipeline

* web: timebox localStorage reset

* web: update min func

Co-authored-by: Jean Hadrien Chabran <jh@chabran.fr>
Co-authored-by: Tom Ross <tom@umpox.com>
2021-09-23 16:32:25 +02:00
Felix Becker
45f9839011
Move all client code into client/ folder (#14480) 2020-10-07 22:23:53 +02:00
Felix Becker
9853cd3058 Fix regressions in regression suite (#7894) 2020-01-20 09:22:30 -06:00