kopia lustrzana https://github.com/dgtlmoon/changedetection.io
				
				
				
			Build - Splitting memory report (#3493)
							rodzic
							
								
									b237fd7201
								
							
						
					
					
						commit
						233189e4f7
					
				| 
						 | 
					@ -246,20 +246,36 @@ jobs:
 | 
				
			||||||
          # @todo - scan the container log to see the right "graceful shutdown" text exists           
 | 
					          # @todo - scan the container log to see the right "graceful shutdown" text exists           
 | 
				
			||||||
          docker rm sig-test
 | 
					          docker rm sig-test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Dump container log and memory report
 | 
					      - name: Dump container log
 | 
				
			||||||
        if: always()
 | 
					        if: always()
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          mkdir output-logs
 | 
					          mkdir output-logs
 | 
				
			||||||
          docker logs test-cdio-basic-tests > output-logs/test-cdio-basic-tests-stdout-${{ env.PYTHON_VERSION }}.txt
 | 
					          docker logs test-cdio-basic-tests > output-logs/test-cdio-basic-tests-stdout-${{ env.PYTHON_VERSION }}.txt
 | 
				
			||||||
          docker logs test-cdio-basic-tests 2> output-logs/test-cdio-basic-tests-stderr-${{ env.PYTHON_VERSION }}.txt
 | 
					          docker logs test-cdio-basic-tests 2> output-logs/test-cdio-basic-tests-stderr-${{ env.PYTHON_VERSION }}.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Extract and display memory test report
 | 
				
			||||||
 | 
					        if: always()
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
          # Extract test-memory.log from the container
 | 
					          # Extract test-memory.log from the container
 | 
				
			||||||
          echo "Extracting test-memory.log from container..."
 | 
					          echo "Extracting test-memory.log from container..."
 | 
				
			||||||
          docker cp test-cdio-basic-tests:/app/changedetectionio/test-memory.log output-logs/test-memory-${{ env.PYTHON_VERSION }}.log || echo "test-memory.log not found in container"
 | 
					          docker cp test-cdio-basic-tests:/app/changedetectionio/test-memory.log output-logs/test-memory-${{ env.PYTHON_VERSION }}.log || echo "test-memory.log not found in container"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          # Display the memory log contents for immediate visibility in workflow output
 | 
					          # Display the memory log contents for immediate visibility in workflow output
 | 
				
			||||||
          echo "=== Memory Test Report ==="
 | 
					          echo "=== Top 10 Highest Peak Memory Tests ==="
 | 
				
			||||||
          cat output-logs/test-memory-${{ env.PYTHON_VERSION }}.log 2>/dev/null || echo "No memory log available"
 | 
					          if [ -f output-logs/test-memory-${{ env.PYTHON_VERSION }}.log ]; then
 | 
				
			||||||
 | 
					            # Sort by peak memory value (extract number before MB and sort numerically, reverse order)
 | 
				
			||||||
 | 
					            grep "Peak memory:" output-logs/test-memory-${{ env.PYTHON_VERSION }}.log | \
 | 
				
			||||||
 | 
					              sed 's/.*Peak memory: //' | \
 | 
				
			||||||
 | 
					              paste -d'|' - <(grep "Peak memory:" output-logs/test-memory-${{ env.PYTHON_VERSION }}.log) | \
 | 
				
			||||||
 | 
					              sort -t'|' -k1 -nr | \
 | 
				
			||||||
 | 
					              cut -d'|' -f2 | \
 | 
				
			||||||
 | 
					              head -10
 | 
				
			||||||
 | 
					            echo ""
 | 
				
			||||||
 | 
					            echo "=== Full Memory Test Report ==="
 | 
				
			||||||
 | 
					            cat output-logs/test-memory-${{ env.PYTHON_VERSION }}.log
 | 
				
			||||||
 | 
					          else
 | 
				
			||||||
 | 
					            echo "No memory log available"
 | 
				
			||||||
 | 
					          fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Store everything including test-datastore
 | 
					      - name: Store everything including test-datastore
 | 
				
			||||||
        if: always()
 | 
					        if: always()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Ładowanie…
	
		Reference in New Issue