@@ -1233,6 +1233,39 @@ def test_from_pr(self):
12331233 print ("Ignoring URLError '%s' in test_from_pr" % err )
12341234 shutil .rmtree (tmpdir )
12351235
1236+ def test_from_pr_token_log (self ):
1237+ """Check that --from-pr doesn't leak GitHub token in log."""
1238+ if self .github_token is None :
1239+ print ("Skipping test_from_pr_token_log, no GitHub token available?" )
1240+ return
1241+
1242+ fd , dummylogfn = tempfile .mkstemp (prefix = 'easybuild-dummy' , suffix = '.log' )
1243+ os .close (fd )
1244+
1245+ args = [
1246+ # PR for foss/2018b, see https://github.com/easybuilders/easybuild-easyconfigs/pull/6424/files
1247+ '--from-pr=6424' ,
1248+ '--dry-run' ,
1249+ '--debug' ,
1250+ # an argument must be specified to --robot, since easybuild-easyconfigs may not be installed
1251+ '--robot=%s' % os .path .join (os .path .dirname (__file__ ), 'easyconfigs' ),
1252+ '--github-user=%s' % GITHUB_TEST_ACCOUNT , # a GitHub token should be available for this user
1253+ ]
1254+ try :
1255+ self .mock_stdout (True )
1256+ self .mock_stderr (True )
1257+ outtxt = self .eb_main (args , logfile = dummylogfn , raise_error = True )
1258+ stdout = self .get_stdout ()
1259+ stderr = self .get_stderr ()
1260+ self .mock_stdout (False )
1261+ self .mock_stderr (False )
1262+ self .assertFalse (self .github_token in outtxt )
1263+ self .assertFalse (self .github_token in stdout )
1264+ self .assertFalse (self .github_token in stderr )
1265+
1266+ except URLError as err :
1267+ print ("Ignoring URLError '%s' in test_from_pr" % err )
1268+
12361269 def test_from_pr_listed_ecs (self ):
12371270 """Test --from-pr in combination with specifying easyconfigs on the command line."""
12381271 if self .github_token is None :
@@ -2710,17 +2743,17 @@ def test_review_pr(self):
27102743
27112744 self .mock_stdout (True )
27122745 self .mock_stderr (True )
2713- # PR for CMake 3.12.1 easyconfig, see https://github.com/easybuilders/easybuild-easyconfigs/pull/6660
2746+ # PR for gzip 1.10 easyconfig, see https://github.com/easybuilders/easybuild-easyconfigs/pull/9921
27142747 args = [
27152748 '--color=never' ,
27162749 '--github-user=%s' % GITHUB_TEST_ACCOUNT ,
2717- '--review-pr=6660 ' ,
2750+ '--review-pr=9921 ' ,
27182751 ]
27192752 self .eb_main (args , raise_error = True )
27202753 txt = self .get_stdout ()
27212754 self .mock_stdout (False )
27222755 self .mock_stderr (False )
2723- regex = re .compile (r"^Comparing CMake-3.12.1 -\S* with CMake-3.12.1 -" )
2756+ regex = re .compile (r"^Comparing gzip-1.10 -\S* with gzip-1.10 -" )
27242757 self .assertTrue (regex .search (txt ), "Pattern '%s' not found in: %s" % (regex .pattern , txt ))
27252758
27262759 def test_set_tmpdir (self ):
0 commit comments