mirror of
				https://github.com/Chocobozzz/PeerTube.git
				synced 2025-02-25 18:55:32 -06:00 
			
		
		
		
	Server: do not enable images tests by default because it needs a special
ffmpeg version
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -13,3 +13,4 @@ public/stylesheets/vendor
 | 
			
		||||
uploads
 | 
			
		||||
thumbnails
 | 
			
		||||
config/production.yaml
 | 
			
		||||
ffmpeg
 | 
			
		||||
 
 | 
			
		||||
@@ -27,6 +27,7 @@ before_script:
 | 
			
		||||
  - mkdir -p $HOME/bin
 | 
			
		||||
  - cp ffmpeg-*-64bit-static/{ffmpeg,ffprobe,ffserver} $HOME/bin
 | 
			
		||||
  - export PATH=$HOME/bin:$PATH
 | 
			
		||||
  - export NODE_TEST_IMAGE=true
 | 
			
		||||
 | 
			
		||||
after_failure:
 | 
			
		||||
  - cat test1/logs/all-logs.log
 | 
			
		||||
 
 | 
			
		||||
@@ -350,18 +350,25 @@ function searchVideoWithSort (url, search, sort, end) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function testImage (url, videoName, imagePath, callback) {
 | 
			
		||||
  request(url)
 | 
			
		||||
    .get(imagePath)
 | 
			
		||||
    .expect(200)
 | 
			
		||||
    .end(function (err, res) {
 | 
			
		||||
      if (err) return callback(err)
 | 
			
		||||
 | 
			
		||||
      fs.readFile(pathUtils.join(__dirname, 'fixtures', videoName + '.jpg'), function (err, data) {
 | 
			
		||||
  // Don't test images if the node env is not set
 | 
			
		||||
  // Because we need a special ffmpeg version for this test
 | 
			
		||||
  if (process.env.NODE_TEST_IMAGE) {
 | 
			
		||||
    request(url)
 | 
			
		||||
      .get(imagePath)
 | 
			
		||||
      .expect(200)
 | 
			
		||||
      .end(function (err, res) {
 | 
			
		||||
        if (err) return callback(err)
 | 
			
		||||
 | 
			
		||||
        callback(null, data.equals(res.body))
 | 
			
		||||
        fs.readFile(pathUtils.join(__dirname, 'fixtures', videoName + '.jpg'), function (err, data) {
 | 
			
		||||
          if (err) return callback(err)
 | 
			
		||||
 | 
			
		||||
          callback(null, data.equals(res.body))
 | 
			
		||||
        })
 | 
			
		||||
      })
 | 
			
		||||
    })
 | 
			
		||||
  } else {
 | 
			
		||||
    console.log('Do not test images. Enable it by setting NODE_TEST_IMAGE env variable.')
 | 
			
		||||
    callback(null, true)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function uploadVideo (url, accessToken, name, description, tags, fixture, specialStatus, end) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user