mirror of
				https://github.com/Frooodle/Stirling-PDF.git
				synced 2025-11-01 01:21:18 +01:00 
			
		
		
		
	
						commit
						0f4eb8398a
					
				
							
								
								
									
										9
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							@ -32,6 +32,15 @@ jobs:
 | 
				
			|||||||
          sudo curl -SL "https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
 | 
					          sudo curl -SL "https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
 | 
				
			||||||
          # sudo chmod +x /usr/local/bin/docker-compose
 | 
					          # sudo chmod +x /usr/local/bin/docker-compose
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up Python
 | 
				
			||||||
 | 
					        uses: actions/setup-python@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          python-version: "3.7"
 | 
				
			||||||
 | 
					          
 | 
				
			||||||
 | 
					      - name: Pip requirements
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					           pip install -r ./cucumber/requirements.txt
 | 
				
			||||||
 | 
					              
 | 
				
			||||||
      - name: Run Docker Compose Tests
 | 
					      - name: Run Docker Compose Tests
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          chmod +x ./test.sh
 | 
					          chmod +x ./test.sh
 | 
				
			||||||
 | 
				
			|||||||
@ -2,3 +2,4 @@ behave
 | 
				
			|||||||
requests
 | 
					requests
 | 
				
			||||||
PyPDF2
 | 
					PyPDF2
 | 
				
			||||||
reportlab
 | 
					reportlab
 | 
				
			||||||
 | 
					PyCryptodome
 | 
				
			||||||
 | 
				
			|||||||
@ -176,9 +176,10 @@ public class ExtractImageScansController {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                return WebResponseUtils.bytesToWebResponse(
 | 
					                return WebResponseUtils.bytesToWebResponse(
 | 
				
			||||||
                        zipBytes, outputZipFilename, MediaType.APPLICATION_OCTET_STREAM);
 | 
					                        zipBytes, outputZipFilename, MediaType.APPLICATION_OCTET_STREAM);
 | 
				
			||||||
            } if (processedImageBytes.size() == 0) { 
 | 
					            }
 | 
				
			||||||
 | 
					            if (processedImageBytes.size() == 0) {
 | 
				
			||||||
                throw new IllegalArgumentException("No images detected");
 | 
					                throw new IllegalArgumentException("No images detected");
 | 
				
			||||||
            }else {
 | 
					            } else {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // Return the processed image as a response
 | 
					                // Return the processed image as a response
 | 
				
			||||||
                byte[] imageBytes = processedImageBytes.get(0);
 | 
					                byte[] imageBytes = processedImageBytes.get(0);
 | 
				
			||||||
 | 
				
			|||||||
@ -71,6 +71,5 @@ public class RepairController {
 | 
				
			|||||||
            Files.deleteIfExists(tempInputFile);
 | 
					            Files.deleteIfExists(tempInputFile);
 | 
				
			||||||
            Files.deleteIfExists(tempOutputFile);
 | 
					            Files.deleteIfExists(tempOutputFile);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										20
									
								
								test.sh
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								test.sh
									
									
									
									
									
								
							@ -42,11 +42,6 @@ test_compose() {
 | 
				
			|||||||
        status=1
 | 
					        status=1
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Perform additional tests if needed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Tear down the service
 | 
					 | 
				
			||||||
    docker-compose -f "$compose_file" down
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return $status
 | 
					    return $status
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -83,7 +78,20 @@ main() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # Test each configuration
 | 
					    # Test each configuration
 | 
				
			||||||
    run_tests "Stirling-PDF-Ultra-Lite" "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml"
 | 
					    run_tests "Stirling-PDF-Ultra-Lite" "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml"
 | 
				
			||||||
 | 
						docker-compose -f "./exampleYmlFiles/docker-compose-latest-ultra-lite.yml" down
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    run_tests "Stirling-PDF" "./exampleYmlFiles/docker-compose-latest.yml"
 | 
					    run_tests "Stirling-PDF" "./exampleYmlFiles/docker-compose-latest.yml"
 | 
				
			||||||
 | 
						if [ $? -eq 0 ]; then
 | 
				
			||||||
 | 
							cd cucumber
 | 
				
			||||||
 | 
							if behave; then
 | 
				
			||||||
 | 
								passed_tests+=("Stirling-PDF-Regression")
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								failed_tests+=("Stirling-PDF-Regression")
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
							cd ..
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
						docker-compose -f "./exampleYmlFiles/docker-compose-latest.yml" down
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    export DOCKER_ENABLE_SECURITY=true
 | 
					    export DOCKER_ENABLE_SECURITY=true
 | 
				
			||||||
    # Run the gradlew build command and check if it fails
 | 
					    # Run the gradlew build command and check if it fails
 | 
				
			||||||
@ -99,7 +107,9 @@ main() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # Test each configuration with security
 | 
					    # Test each configuration with security
 | 
				
			||||||
    run_tests "Stirling-PDF-Ultra-Lite-Security" "./exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml"
 | 
					    run_tests "Stirling-PDF-Ultra-Lite-Security" "./exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml"
 | 
				
			||||||
 | 
						docker-compose -f "./exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml" down
 | 
				
			||||||
    run_tests "Stirling-PDF-Security" "./exampleYmlFiles/docker-compose-latest-security.yml"
 | 
					    run_tests "Stirling-PDF-Security" "./exampleYmlFiles/docker-compose-latest-security.yml"
 | 
				
			||||||
 | 
						docker-compose -f "./exampleYmlFiles/docker-compose-latest-security.yml" down
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Report results
 | 
					    # Report results
 | 
				
			||||||
    echo "All tests completed in $SECONDS seconds."
 | 
					    echo "All tests completed in $SECONDS seconds."
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user