Skip to content

Commit 60a8ba0

Browse files
authored
Update Components build and E2E testing instructions (#56106)
1 parent 65f0f67 commit 60a8ba0

File tree

1 file changed

+39
-26
lines changed

1 file changed

+39
-26
lines changed

src/Components/README.md

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,42 +29,56 @@ The following contains a description of each sub-directory in the `Components` d
2929

3030
## Development Setup
3131

32-
### Build
32+
**Note**: To build other specific projects from source, follow the instructions [on building the project](../../docs/BuildFromSource.md#step-3-build-the-repo).
3333

34-
To build this specific project from source, follow the instructions [on building the project](../../docs/BuildFromSource.md#step-3-build-the-repo).
34+
### Building ASP.NET Core Components
3535

36-
**Note:** You also need to run the preceding `build` command in the command line before building in VS to ensure that the Web.JS dependency is built.
36+
1. You'll need to install [Node](https://nodejs.org) on your machine.
3737

38-
### A Guide to build Web.JS
38+
1. Ensure the repository is clean from any asset that could remain from previous version of the repository. This is recommended when switching branches, or after updating the working branch.
3939

40-
Prior to building `src\Components\Web.JS\`
40+
```powershell
41+
git clean -xdff
42+
```
4143

42-
1. You'll need to install [Node](https://nodejs.org) on your machine.
44+
You may need to kill some processes holding on files that are being deleted, like closing Visual Studio and other `msbuild` or `dotnet` processes. There may also be lingering headless `chrome` processes, but they are not included in this command. The following command may help you but be aware that this could also stop other important tasks:
45+
46+
```powershell
47+
Get-Process dotnet, escape-node-job, msbuild, VBCSCompiler, node, vstest.console, Microsoft.CodeAnalysis.LanguageServer -ErrorAction Continue | Stop-Process;
48+
```
4349

44-
2. You'll need to run the `restore` script locally to install the required dotnet dependencies and setup the repo. The `restore` script is located in the root of the repo.
50+
1. Use NPM to restore the required JavaScript modules. This doesn't require an Internet connection since the sources are read from a sub-module.
51+
52+
```powershell
53+
npm ci --offline
54+
```
55+
56+
1. You'll need to run the `restore` script locally to install the required dotnet dependencies and setup the repo. The `restore` script is located in the root of the repo.
4557

4658
```bash
4759
./restore.sh
4860
```
4961

5062
```powershell
51-
./restore.ps1
63+
./restore.cmd
5264
```
5365

54-
3. After the restore script has finished executing, activate the locally installed .NET by running the following command.
66+
1. Now you can build all the JavaScript assets required by the repository (including SignalR for instance) by running the following command:
5567

56-
```bash
57-
source activate.sh
68+
```powershell
69+
npm run build
5870
```
5971

72+
1. Build the Components:
73+
6074
```powershell
61-
. ./activate.ps1
75+
./src/Components/build.cmd
6276
```
6377

64-
4. Now you can build `src\Components\Web.JS\` by running the following commands in the `src\Components\Web.JS` directory:
78+
2. Optionally, open the Components in Visual Studio:
6579

6680
```powershell
67-
dotnet build
81+
./src/Components/startvs.cmd
6882
```
6983

7084
### Test
@@ -84,23 +98,22 @@ These tests are run in the CI as part of the [`aspnetcore-components-e2e`](https
8498

8599
#### How to run the E2E Tests
86100

87-
To run the tests for this project, follow these steps (from the root directory):
101+
The E2E tests can be run and debugged directly from Visual Studio (as explained in the previous section). To run the tests from the command line,
102+
follow the previous build steps and then these commands:
88103

89-
##### Windows
104+
1. Activate the locally installed .NET by running the following command.
105+
106+
```bash
107+
source activate.sh
108+
```
90109

91110
```powershell
92-
./restore.cmd
93-
npm install --prefix ./src/Components/test/E2ETest
94-
. .\activate.ps1
95-
dotnet test ./src/Components/test/E2ETest
111+
. ./activate.ps1
96112
```
97113

98-
##### Linux / MacOS
114+
1. Start the tests.
99115

100-
```shell
101-
./restore.sh
102-
npm install --prefix ./src/Components/test/E2ETest
103-
source ./activate.sh
116+
```powershell
104117
dotnet test ./src/Components/test/E2ETest
105118
```
106119

@@ -123,4 +136,4 @@ dotnet test --no-build
123136

124137
## More Information
125138

126-
For more information, see the [ASP.NET Core README](../../README.md).
139+
For more information, see the [ASP.NET Core README](https://github.com/dotnet/aspnetcore/blob/main/README.md).

0 commit comments

Comments
 (0)