-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
111 lines (92 loc) · 4.98 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
b.PHONY: help
help:
@cat ./MakefileHelp
# ---------------------------------------------------------------------------------------
# -- Dotnet commands
# ---------------------------------------------------------------------------------------
.PHONY: build
build:
cd src/StockportWebapp; dotnet build
.PHONY: run
run:
dotnet run --project ./src/StockportWebapp/StockportWebapp.csproj --urls="http://localhost:5002;https://localhost:5003"
.PHONY: dotnet-restore
dotnet-restore: restore
.PHONY: restore
restore:
dotnet restore
.PHONY: publish
publish:
@echo Publishing application
cd ./src/StockportWebapp && dotnet publish -c Release -o publish
# ---------------------------------------------------------------------------------------
# -- Unit-test
# ---------------------------------------------------------------------------------------
.PHONY: unit-test
unit-test:
cd test/StockportWebappTests; dotnet test
# ---------------------------------------------------------------------------------------
# -- Unit tests coverage
# ---------------------------------------------------------------------------------------
.PHONY: coverage
coverage:
cd test/StockportWebappTests;rm TestResults -r -f
dotnet build
dotnet test -l "console;verbosity=normal" -p:CollectCoverage=true -p:CoverletOutputFormat=\"opencover\" -p:CoverletOutput=TestResults/Coverage.xml -p:SkipAutoProps=true /p:Exclude=\"**/Constants/*,[*]StockportWebapp.Models.Config*,[*]StockportWebapp.Models.Emails*,[*]StockportWebapp.Models.Enums*,[*]StockportWebapp.Models.Exceptions*,[*]StockportWebapp.Models.Groups*,[*]StockportWebapp.Models.Responses*\" /p:ExcludeByFile=\"**/StockportWebapp/Views/**/*.cshtml,**/StockportWebapp/EmailTemplates/*.cshtml\" -p:ExcludeByAttribute="ExcludeFromCodeCoverage"
# ---------------------------------------------------------------------------------------
# -- Unit tests coverage with threshold
# ---------------------------------------------------------------------------------------
.PHONY: coverage-threshold
coverage-threshold:
cd test/StockportWebappTests;rm TestResults -r -f
dotnet test -l "console;verbosity=normal" -p:CollectCoverage=true -p:CoverletOutputFormat=\"opencover\" -p:CoverletOutput=TestResults/Coverage.xml -p:SkipAutoProps=true /p:Exclude=\"**/Constants/*,[*]StockportWebapp.Models.Config*,[*]StockportWebapp.Models.Emails*,[*]StockportWebapp.Models.Enums*,[*]StockportWebapp.Models.Exceptions*,[*]StockportWebapp.Models.Groups*,[*]StockportWebapp.Models.Responses*\" /p:ExcludeByFile=\"**/StockportWebapp/Views/**/*.cshtml,**/StockportWebapp/EmailTemplates/*.cshtml\" -p:ExcludeByAttribute="ExcludeFromCodeCoverage" -p:Threshold=$(threshold)
# ---------------------------------------------------------------------------------------
# -- Unit tests coverage report, opens index.html in Chrome
# ---------------------------------------------------------------------------------------
.PHONY: report
report:
cd test/StockportWebappTests; rm TestCoverageResults -r -f && \
reportgenerator -reports:TestResults/Coverage.xml -targetdir:TestCoverageResults -reporttypes:Html && \
start Chrome $$PWD/TestCoverageResults/index.html
.PHONY: report-teamcity
report-teamcity:
reportgenerator -reports:test/StockportWebappTests/TestResults/coverage.xml -reporttypes:"TeamCitySummary;HtmlSummary" -targetdir:TestResults
# ---------------------------------------------------------------------------------------
# -- Unit tests coverage tools
# ---------------------------------------------------------------------------------------
.PHONY: coverage-tools
coverage-tools:
cd test/StockportWebappTests && \
dotnet tool install -g dotnet-reportgenerator-globaltool && \
echo "Please ensure that the path environment variable us updated with `C:\Users\{your-user}\.dotnet\tools`" && \
reportgenerator
# ---------------------------------------------------------------------------------------
# -- Unit tests clear coverage report
# ---------------------------------------------------------------------------------------
.PHONY: clear-report
clear-report:
cd test/StockportWebappTests;rm TestResults -r -f; rm TestCoverageResults -r -f
# ---------------------------------------------------------------------------------------
# -- Ui-test
# ---------------------------------------------------------------------------------------
.PHONY: ui-test
ui-test:
cd test/StockportWebappTests_UI/ && ./runtests.cmd
# ---------------------------------------------------------------------------------------
# -- Gulp tasks
# ---------------------------------------------------------------------------------------
.PHONY: css
css:
cd src/StockportWebapp && gulp css
.PHONY: js
js:
cd src/StockportWebapp && gulp js
.PHONY: lint
css:
cd src/StockportWebapp && npm run lint
.PHONY: build
js:
cd src/StockportWebapp && gulp build
.PHONY: watch
watch:
cd src/StockportWebapp && gulp watch