mirror of
				https://code.forgejo.org/actions/forgejo-release.git
				synced 2025-11-04 06:41:57 +02:00 
			
		
		
		
	feat: add setup_tea tests
- add test to check if system tea bin is detected - add test to check if downloading tea bin works
This commit is contained in:
		
							parent
							
								
									85ec83849a
								
							
						
					
					
						commit
						efbafaf169
					
				
					 2 changed files with 18 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -7,4 +7,6 @@ jobs:
 | 
			
		|||
 | 
			
		||||
      - name: Unit tests of the supporting script forgejo-release.sh
 | 
			
		||||
        run: |
 | 
			
		||||
          testdata/forgejo-release-test.sh test_maybe_sign_release
 | 
			
		||||
          testdata/forgejo-release-test.sh test_system_tea_bin
 | 
			
		||||
          testdata/forgejo-release-test.sh test_download_tea_bin
 | 
			
		||||
          testdata/forgejo-release-test.sh test_maybe_sign_release
 | 
			
		||||
							
								
								
									
										16
									
								
								testdata/forgejo-release-test.sh
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								testdata/forgejo-release-test.sh
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -4,13 +4,27 @@
 | 
			
		|||
set -ex
 | 
			
		||||
PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}:  '
 | 
			
		||||
 | 
			
		||||
test_system_tea_bin() {
 | 
			
		||||
	SYSTEM_TEA_BIN=$TMP_DIR/tea
 | 
			
		||||
	touch $SYSTEM_TEA_BIN && chmod +x $SYSTEM_TEA_BIN
 | 
			
		||||
	export PATH=$TMP_DIR:$PATH
 | 
			
		||||
    setup_tea
 | 
			
		||||
	test $TEA_BIN == $SYSTEM_TEA_BIN
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
test_download_tea_bin() {
 | 
			
		||||
    # assume tea is not installed on system
 | 
			
		||||
    setup_tea
 | 
			
		||||
    test $TEA_BIN == $TMP_DIR/tea
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
test_teardown() {
 | 
			
		||||
    setup_api
 | 
			
		||||
    api DELETE repos/$REPO/releases/tags/$TAG || true
 | 
			
		||||
    api DELETE repos/$REPO/tags/$TAG || true
 | 
			
		||||
    rm -fr dist/release
 | 
			
		||||
    setup_tea
 | 
			
		||||
    $BIN_DIR/tea login delete $DOER || true
 | 
			
		||||
    $TEA_BIN login delete $DOER || true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
test_reset_repo() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue