merge resoled
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
commit
4a12988b66
@ -0,0 +1,59 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: mcr.microsoft.com/dotnet/sdk:6.0
|
||||
volumes:
|
||||
- name: docs
|
||||
path: /docs
|
||||
commands:
|
||||
- cd EntityFramework_LoL/Sources/
|
||||
- dotnet restore LeagueOfLegends.sln
|
||||
- dotnet build LeagueOfLegends.sln -c Release --no-restore
|
||||
- dotnet publish LeagueOfLegends.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release
|
||||
# docker image build
|
||||
- name: docker-build-and-push
|
||||
image: plugins/docker
|
||||
settings:
|
||||
dockerfile: EntityFramework_LoL/Sources/Dockerfile
|
||||
context: EntityFramework_LoL/Sources/
|
||||
registry: hub.codefirst.iut.uca.fr
|
||||
repo: hub.codefirst.iut.uca.fr/git/arthur.valin/League-of-Legends_Project
|
||||
username:
|
||||
from_secret: SECRET_REGISTRY_USERNAME
|
||||
password:
|
||||
from_secret: SECRET_REGISTRY_PASSWORD
|
||||
- name: tests
|
||||
image: mcr.microsoft.com/dotnet/sdk:6.0
|
||||
commands:
|
||||
- cd EntityFramework_LoL/Sources/
|
||||
- dotnet restore LeagueOfLegends.sln
|
||||
- dotnet test LeagueOfLegends.sln --no-restore
|
||||
depends_on: [build]
|
||||
|
||||
|
||||
|
||||
- name: generate-and-deploy-docs
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
|
||||
failure: ignore
|
||||
volumes:
|
||||
- name: docs
|
||||
path: /docs
|
||||
commands:
|
||||
#- cd Documentation/doxygen
|
||||
#- doxygen Doxyfile
|
||||
- /entrypoint.sh
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
depends_on: [ build ]
|
||||
|
||||
volumes:
|
||||
- name: docs
|
||||
temp: {}
|
Binary file not shown.
@ -1,6 +1,7 @@
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
""
|
||||
],
|
||||
"PreviewInSolutionExplorer": false
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
""
|
||||
],
|
||||
"SelectedNode": "\\LeagueOfLegends.sln",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
@ -0,0 +1,26 @@
|
||||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["API_LoL_Project/API_LoL_Project.csproj", "API_LoL_Project/"]
|
||||
COPY ["StubLib/StubLib.csproj", "StubLib/"]
|
||||
COPY ["Model/Model.csproj", "Model/"]
|
||||
COPY ["Shared/Shared.csproj", "Shared/"]
|
||||
COPY ["DTO/DTO.csproj", "DTO/"]
|
||||
RUN dotnet restore "API_LoL_Project/API_LoL_Project.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/API_LoL_Project"
|
||||
RUN dotnet build "API_LoL_Project.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "API_LoL_Project.csproj" -c Release -o /app/publish
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "API_LoL_Project.dll"]
|
@ -0,0 +1,62 @@
|
||||
using API_LoL_Project.Controllers;
|
||||
using DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Model;
|
||||
using StubLib;
|
||||
|
||||
namespace TestProject1
|
||||
{
|
||||
[TestClass]
|
||||
public class ChampionControllerTest
|
||||
{
|
||||
public readonly ChampionsController championCtrl;
|
||||
|
||||
public readonly IChampionsManager stubMgr;
|
||||
public ChampionControllerTest()
|
||||
{
|
||||
stubMgr = new StubData().ChampionsMgr;
|
||||
|
||||
championCtrl = new ChampionsController(stubMgr);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task TestGetChampions()
|
||||
{
|
||||
var getResult = await championCtrl.Get();
|
||||
|
||||
var objectRes = getResult as OkObjectResult;
|
||||
|
||||
Assert.IsNotNull(objectRes);
|
||||
|
||||
var champions = objectRes?.Value as IEnumerable<ChampionDTO>;
|
||||
Assert.IsNotNull(champions);
|
||||
|
||||
Assert.AreEqual(champions.Count(), await stubMgr.GetNbItems());
|
||||
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public async void TestPostChampions()
|
||||
{
|
||||
var chamionGetResul = championCtrl.Get();
|
||||
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async void TestUpdateChampions()
|
||||
{
|
||||
var chamionGetResul = championCtrl.Get();
|
||||
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public async void TestDeleteChampions()
|
||||
{
|
||||
var chamionGetResul = championCtrl.Get();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\API_LoL_Project\API_LoL_Project.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,11 @@
|
||||
namespace TestProject1
|
||||
{
|
||||
[TestClass]
|
||||
public class UnitTest1
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestMethod1()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
global using Microsoft.VisualStudio.TestTools.UnitTesting;
|
@ -0,0 +1,46 @@
|
||||
using API_LoL_Project.Controllers;
|
||||
using DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Model;
|
||||
using StubLib;
|
||||
using System.Net;
|
||||
|
||||
namespace Test_Api
|
||||
{
|
||||
[TestClass]
|
||||
public class ChampionControllerTest
|
||||
{
|
||||
public readonly ChampionsController championCtrl;
|
||||
|
||||
public readonly IDataManager stubMgr;
|
||||
public ChampionControllerTest()
|
||||
{
|
||||
var stubMgr = new StubData();
|
||||
|
||||
championCtrl = new ChampionsController(stubMgr);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task TestGetChampions()
|
||||
{
|
||||
var getResult = await championCtrl.Get();
|
||||
Console.WriteLine(getResult);
|
||||
var objectRes = getResult as OkObjectResult;
|
||||
|
||||
Assert.AreEqual(200, objectRes.StatusCode);
|
||||
|
||||
Assert.IsNotNull(objectRes);
|
||||
|
||||
var champions = objectRes?.Value as IEnumerable<ChampionDTO>;
|
||||
|
||||
Assert.IsNotNull(champions);
|
||||
|
||||
/*
|
||||
Assert.AreEqual(champions.Count(), await stubMgr.ChampionsMgr.GetNbItems());*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\API_LoL_Project\API_LoL_Project.csproj" />
|
||||
<ProjectReference Include="..\DTO\DTO.csproj" />
|
||||
<ProjectReference Include="..\Model\Model.csproj" />
|
||||
<ProjectReference Include="..\StubLib\StubLib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1 @@
|
||||
global using Microsoft.VisualStudio.TestTools.UnitTesting;
|
Loading…
Reference in new issue