Licensed under the MIT license
Assessor Service Web | |
Info | A service which allows an End Point Assessment Organisation (EPAO) to register and assess standards |
Build | |
Web | https://localhost:5015/ |
https://localhost:5015/find-an-assessment-opportunity |
Assessor External API | |
Info | An API which allows an EPAO to access Record a grade functionality programmatically |
Build | |
Api | https://www.gov.uk/guidance/record-a-grade-api |
See Support Site for EFSA developer details.
-
Install .NET Core 2.2 SDK
-
Install Visual Studio 2019 with these workloads:
- ASP.NET and web development
- Azure development
-
Install SQL Management Studio
-
Install Azure Storage Emulator (Make sure you are on atleast v5.3)
-
Install Azure Storage Explorer
-
Administrator Access
-
Optionally Install Specflow
- Clone this repository
- Open Visual Studio as an administrator
-
Build the solution SFA.DAS.AssessorService.sln
-
Either use Visual Studio's
Publish Database
tool to publish the database project SFA.DAS.AssessorService.Database to name {{database name}} on {{local instance name}}or
-
Create a database manually named {{database name}} on {{local instance name}} and run each of the
.sql
scripts in the SFA.DAS.AssessorService.Database project.
- Get the das-assessor-service configuration json file from das-employer-config; which is a non-public repository.
- Create a Configuration table in your (Development) local Azure Storage account.
- Add a row to the Configuration table with fields: PartitionKey: LOCAL, RowKey: SFA.DAS.AssessorService_1.0, Data: {{The contents of the local config json file}}.
- Update Configuration SFA.DAS.AssessorService_1.0, Data { "SqlConnectionstring":"Server={{local instance name}};Initial Catalog={{database name}};Trusted_Connection=True;" }
Follow the EPAO Data Setup Guide to populate local database test data.
The default JSON configuration was created to work with dotnet run:
-
Navigate to src/SFA.DAS.AssessorService.Web/
-
run
dotnet restore
-
run
dotnet run
-
Navigate to src/SFA.DAS.AssessorService.Application.Api/
-
run
dotnet restore
-
run
dotnet run
Note: Running the solution from VS2019 is not supported currently as the Login Service (OpenId Identity Server 4) is configured by default for the client end point to originate at https://localhost:5015 which is not a valid port for IIS Express; altering the Login Service configuration is out of scope for this Readme.
Specflow is currently used for integrations testing the Internal API. It is configured to run using the NUnit Test runner.
As such it requires
1). To be ran using the NUnit Test Runner.
2). The SFA.DAS.AssessorService.Application.Api project to be running in advance.
3). The BaseAddress in the app.config to be set to the base address of the running SFA.DAS.AssessorService.Application.Api project.
SonarCloud analysis can be performed using a docker container which can be built from the included dockerfile.
Docker must be running Windows containers in this instance
An example of the docker run command to analyse the code base can be found below.
For this docker container to be successfully created you will need:
- docker running Windows containers
- a user on SonarCloud.io with permission to run analysis
- a SonarQube.Analysis.xml file in the root of the git repository.
This file takes the format:
<SonarQubeAnalysisProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sonarsource.com/msbuild/integration/2015/1">
<Property Name="sonar.host.url">https://sonarcloud.io</Property>
<Property Name="sonar.login">[Your SonarCloud user token]</Property>
</SonarQubeAnalysisProperties>
docker run [OPTIONS] IMAGE COMMAND
docker run --rm -v c:/projects/das-assessor-service:c:/projects/das-assessor-service -w c:/projects/das-assessor-service 3d9151a444b2 powershell -F c:/projects/das-assessor-service/sonarcloud/analyse.ps1
Option | Description |
---|---|
--rm | Remove any existing containers for this image |
-v | Bind the current directory of the host to the given directory in the container ($PWD may be different on your platform). This should be the folder where the code to be analysed is |
-w | Set the working directory |
Execute the analyse.ps1 PowerShell script
Please follow the Walkthrough; which is a non-public Wiki.
If you get issues with localhost certificate validation when accessing the local login service (e.g. "AuthenticationException: The remote certificate is invalid according to the validation procedure") then run the following command from the login service directory to install the local dev certificates
dotnet dev-certs https --trust
In the dialog that appears confirm the certificate install.
If you get issues with the target framework when building (e.g. it is targeting .net core 3 instead of 2.2.) then add a global.json file in each of the projects being run with the required target framework specified as follows
{
"sdk": {
"version": "2.2.207"
}
}
to see the installed SDK versions run the following command
dotnet --info