File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ on :
2+ push :
3+ branches :
4+ - " main"
5+ pull_request :
6+ branches :
7+ - " main"
8+
9+ env :
10+ TEST_TAG : corefiling/pdf2html:test
11+
12+ jobs :
13+ docker :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Checkout
17+ uses : actions/checkout@v3
18+ - name : Set up QEMU
19+ uses : docker/setup-qemu-action@v2
20+ - name : Set up Docker Buildx
21+ uses : docker/setup-buildx-action@v2
22+ - name : Build and export to Docker
23+ uses : docker/build-push-action@v4
24+ with :
25+ context : ./src/Pdf2Html
26+ load : true
27+ tags : ${{ env.TEST_TAG }}
28+ - name : Set up Dotnet
29+ uses : actions/setup-dotnet@v3
30+ with :
31+ dotnet-version : " 7.x"
32+ - name : E2E tests
33+ run : |
34+ docker run --rm --detach -p 8080:8080 --name pdf2html ${{ env.TEST_TAG }}
35+ dotnet test
36+ docker stop pdf2html
Original file line number Diff line number Diff line change @@ -15,4 +15,4 @@ WORKDIR /app
1515COPY --from=build /app ./
1616ENV ASPNETCORE_URLS=http://+:8080
1717EXPOSE 8080
18- CMD ["./pdf2html " ]
18+ CMD ["./Pdf2Html " ]
Original file line number Diff line number Diff line change 55 <Nullable >enable</Nullable >
66 <ImplicitUsings >enable</ImplicitUsings >
77 <Version >1.0.0</Version >
8- <AssemblyName >Pdf2html </AssemblyName >
9- <RootNamespace >Pdf2html </RootNamespace >
8+ <AssemblyName >Pdf2Html </AssemblyName >
9+ <RootNamespace >Pdf2Html </RootNamespace >
1010 </PropertyGroup >
1111
1212 <ItemGroup >
Original file line number Diff line number Diff line change @@ -32,8 +32,10 @@ public async Task TestConvertPdf()
3232 var response = await _client . PostAsync ( "/" , new StreamContent ( GetResourceStream ( "CS_cheat_sheet.pdf" ) ) ) ;
3333 Assert . Multiple ( async ( ) =>
3434 {
35- Assert . That ( response . StatusCode , Is . EqualTo ( HttpStatusCode . OK ) ) ;
36- Assert . That ( await response . Content . ReadAsStreamAsync ( ) , Is . EqualTo ( GetResourceStream ( "CS_cheat_sheet.html" ) ) ) ;
35+ var responseStream = await response . Content . ReadAsStreamAsync ( ) ;
36+ Assert . That ( response . StatusCode , Is . EqualTo ( HttpStatusCode . OK ) ,
37+ ( ) => $ "Conversion failed: { new StreamReader ( responseStream ) . ReadToEnd ( ) } ") ;
38+ Assert . That ( responseStream , Is . EqualTo ( GetResourceStream ( "CS_cheat_sheet.html" ) ) ) ;
3739 } ) ;
3840 }
3941
You can’t perform that action at this time.
0 commit comments