Skip to content

Commit 0fa6b05

Browse files
authored
Merge branch 'galaxyproject:dev' into job-completion-email-citation
2 parents 97d9b24 + 1d4f43c commit 0fa6b05

341 files changed

Lines changed: 4351 additions & 3587 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_container_image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ jobs:
250250
sed -i "s/^ tag:.*/ tag: \"${{ needs.build.outputs.tag }}\"/" galaxy/values.yaml
251251
252252
- name: Create Pull Request
253-
uses: peter-evans/create-pull-request@v6
253+
uses: peter-evans/create-pull-request@v7
254254
with:
255255
token: ${{ secrets.GALAXY_HELM_PULL_REQUEST_TOKEN }}
256256
commit-message: "Update Galaxy to version ${{ needs.build.outputs.version }}"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ on:
33
push:
44
paths:
55
- 'client/**'
6-
- '.github/workflows/jest.yaml'
6+
- '.github/workflows/client-unit.yaml'
77
pull_request:
88
paths:
99
- 'client/**'
10-
- '.github/workflows/jest.yaml'
10+
- '.github/workflows/client-unit.yaml'
1111
concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}
1313
cancel-in-progress: true
@@ -32,6 +32,6 @@ jobs:
3232
- name: Stage client libs (Gulp)
3333
run: yarn run gulp client
3434
working-directory: client
35-
- name: Run Unit Tests
36-
run: yarn jest
35+
- name: Run Vitest Unit Tests
36+
run: yarn test
3737
working-directory: client

client/.eslintrc.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,17 @@ module.exports = {
113113
plugins: basePlugins,
114114
overrides: [
115115
{
116-
files: ["**/*.test.js", "**/*.test.ts", "**/tests/jest/**"],
117-
env: {
118-
jest: true,
116+
files: ["**/*.test.js", "**/*.test.ts", "**/tests/vitest/**"],
117+
globals: {
118+
vi: "readonly",
119+
describe: "readonly",
120+
it: "readonly",
121+
expect: "readonly",
122+
beforeEach: "readonly",
123+
afterEach: "readonly",
124+
beforeAll: "readonly",
125+
afterAll: "readonly",
126+
test: "readonly",
119127
},
120128
},
121129
{

client/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ developer-facing API of your new code.
114114

115115
### Testing Technologies
116116

117-
[Galaxy uses Jest](https://jestjs.io/) for its client-side unit testing
117+
[Galaxy uses Vitest](https://vitest.dev/) for its client-side unit testing
118118
framework.
119119

120120
For testing Vue components, we use the [Vue testing
121121
utils](https://vue-test-utils.vuejs.org/) to mount individual components in a
122-
test bed and check them for rendered features. Please use jest-based mocking
123-
for isolating test functionality.
122+
test bed and check them for rendered features. Please use Vitest's mocking
123+
capabilities for isolating test functionality.
124124

125125
### Linting
126126

@@ -152,17 +152,17 @@ executing all the client tests:
152152

153153
yarn test
154154

155-
##### Watch and rerun jest unit tests every time a source file changes
155+
##### Watch and rerun unit tests every time a source file changes
156156

157157
This is incredibly handy, and there are a host of options in the interactive
158-
terminal this starts for executing Jest tests.
158+
terminal this starts for executing Vitest tests.
159159

160-
yarn run jest-watch
160+
yarn test:watch
161161

162162
##### Run only specified test files when a source file changes
163163

164-
yarn run jest-watch MyModule
164+
yarn test:watch MyModule
165165

166-
yarn run jest-watch Dialog
166+
yarn test:watch Dialog
167167

168-
yarn run jest-watch workflow/run
168+
yarn test:watch workflow/run

client/docs/composables.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ const store = new Vuex.Store({
7575
The second option is to mock the composable:
7676

7777
```js
78+
import { vi } from "vitest";
7879
import { useCurrentUser } from "@/composables/user";
7980

80-
jest.mock("composables/user");
81+
vi.mock("composables/user");
8182
useCurrentUser.mockReturnValue({
8283
currentUser: {},
8384
});

client/docs/providers-and-renderers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ mandatory markup, just one big empty slot.
125125
// Testing a renderless component
126126

127127
import { shallowMount } from "@vue/test-utils";
128-
import { getLocalVue, waitForLifecyleEvent } from "tests/jest/helpers";
128+
import { getLocalVue, waitForLifecyleEvent } from "@tests/vitest/helpers";
129129
import DoodadProvider from "./DoodadProvider";
130130

131131
describe("A renderless component", () => {

client/docs/unit-testing/debugging-unit-tests.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ parameters actually does.
77
I've gone ahead and annotated all the options, hopefully this will save some time, at least until VS
88
code updates its test extensions again.
99

10-
#### To debug a single Jest test:
10+
#### To debug a single Vitest test:
1111

12-
1. Open a jest test (a file that ends with \*.test.js)
12+
1. Open a vitest test (a file that ends with \*.test.js or \*.test.ts)
1313

1414
1. Make sure the test file is selected, especially if you have multiple files open. This process
1515
will fail confusingly and without obvious error if you have not launched the debugger with the
16-
actual Jest test file selected, and it's easy to accidentally click into another file if you've
16+
actual Vitest test file selected, and it's easy to accidentally click into another file if you've
1717
got a dozen open.
1818

1919
1. Place a breakpoint in the margin of the file. You can place breakpoints anywhere in your source,
20-
but you must launch the debugger while the jest file is selected because that is where jest and
21-
webpack will start compiling. Alternatively, you can manually override the selected file in the
20+
but you must launch the debugger while the vitest file is selected because that is where vitest
21+
will start compiling. Alternatively, you can manually override the selected file in the
2222
configuration definition, like if you're testing the same file over and over again and don't want
2323
to worry about selecting it.
2424

@@ -30,7 +30,7 @@ code updates its test extensions again.
3030
1. Click on the "Run and Debug" tab from the vscode icons on the left and choose the sample launch
3131
configuration (defined below) from the dropdown "run and debug". Or just hit F5.
3232

33-
1. Wait a bit, for webpack to compile everything, eventually you should be able to hover over
33+
1. Wait a bit, for vitest to compile everything, eventually you should be able to hover over
3434
variables near your breakpoint and see their values in the "Variables" section of the Run and
3535
Debug pane.
3636

@@ -41,28 +41,25 @@ code updates its test extensions again.
4141
"configurations": [
4242
{
4343
"type": "node",
44-
"name": "debug selected jest test",
44+
"name": "debug selected vitest test",
4545
"request": "launch",
4646

47-
// launches version of jest from inside the node_modules
47+
// launches version of vitest from inside the node_modules
4848
// this means you need to have run yarn first
49-
"program": "${workspaceFolder}/client/node_modules/jest/bin/jest",
49+
"program": "${workspaceFolder}/client/node_modules/vitest/vitest.mjs",
5050
"args": [
51-
// Alias -i.
52-
// Normally jest opens up a bunch of workers to run all your tests faster
53-
// but we don't want that right now.
54-
"--runInBand",
51+
// Run tests in a single thread for debugging
52+
"--no-threads",
5553

56-
// finds jest config
57-
"--config",
58-
"${workspaceFolder}/client/tests/jest/jest.config.js",
54+
// Run in watch mode so tests can be re-run
55+
"--watch",
5956

6057
// This is how vscode references the currently selected file
6158
"${file}"
6259
],
6360
"cwd": "${workspaceFolder}/client",
6461

65-
// opens jest output in integrated terminal
62+
// opens vitest output in integrated terminal
6663
"console": "integratedTerminal",
6764

6865
// allows you to place breakpoints right in vscode's gutter

client/docs/unit-testing/readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
[Galaxy uses Jest](https://jestjs.io/) for its client-side unit testing
1+
[Galaxy uses Vitest](https://vitest.dev/) for its client-side unit testing
22
framework.
33

44
For testing Vue components, we use the [Vue testing
55
utils](https://vue-test-utils.vuejs.org/) to mount individual components in a
6-
test bed and check them for rendered features. Please use jest-based mocking
7-
for isolating test functionality.
6+
test bed and check them for rendered features. Please use Vitest's mocking
7+
capabilities for isolating test functionality.
88

99
### Specific test scenarios & examples
1010

client/docs/unit-testing/strategies.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ export function theThingYouReallyCareAbout() {
3737

3838
```js static
3939
// myModule.test.js
40+
import { vi } from "vitest";
4041
import { theThingYouReallyCareAbout, redirectTo } from "./myModule";
4142

42-
// calling jest.mock on the appropriate import path wraps the exports and gives
43+
// calling vi.mock on the appropriate import path wraps the exports and gives
4344
// access to new testing methods like mockImplementation
44-
jest.mock("./myModule");
45+
vi.mock("./myModule");
4546
redirectTo.mockImplementation((url) => {
4647
console.log(`I would have gone to: ${url}`);
4748
});

client/docs/unit-testing/writing-tests.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ The other side of the same coin is to test _only_ the unit in question. If your
2323
component has a model that uses a service that touches Vuex, which then uses
2424
Axios to fetch some data -- don't test all that at once. Break things apart and
2525
mock functionality to isolate testing to units. End to end testing is a
26-
separate thing that shouldn't be attempted using spec tests in Jest.
26+
separate thing that shouldn't be attempted using spec tests in Vitest.
2727

2828
Assume nobody cares _how_ your code works, we just need to know that the public
2929
API you designed _does_ work. If performance problems or new tech necessitate a
3030
re-write, these tests become a guide for the next implementation.
3131

3232
### Writing a test file
3333

34-
Jest will try to test any file ending in "\*.test.js". Please place your test
34+
Vitest will try to test any file ending in "\*.test.js" or "\*.test.ts". Please place your test
3535
files inside client/src folders right next to whatever files that they are
3636
testing.
3737

38-
Jest has extensive documentation on the expect API, mocking, and more on the
39-
[official docs page](https://jestjs.io/docs/en/getting-started.html), which will
38+
Vitest has extensive documentation on the expect API, mocking, and more on the
39+
[official docs page](https://vitest.dev/guide/), which will
4040
be your best resource here.
4141

4242
```js static
@@ -63,10 +63,10 @@ describe("some module you wrote", () => {
6363
});
6464
```
6565

66-
### Check out the Jest helper functions
66+
### Check out the Vitest helper functions
6767

6868
We have created some [common helpers for common testing
69-
scenarios](https://github.com/galaxyproject/galaxy/blob/dev/client/tests/jest/helpers.js).
69+
scenarios](https://github.com/galaxyproject/galaxy/blob/dev/client/tests/vitest/helpers.js).
7070

7171
### Mocking API calls
7272

0 commit comments

Comments
 (0)