File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -45,30 +45,17 @@ namespace :spec do
45
45
t . pattern = Dir . glob ( 'spec/**/*_spec.rb' )
46
46
end
47
47
48
- def check_for_token
49
- begin
50
- github_token = ENV [ 'GITHUB_TOKEN' ] || File . read ( File . expand_path ( "~/.elastic/github.token" ) )
51
- rescue Errno ::ENOENT => e
52
- end
53
- raise ArgumentError , 'GITHUB_TOKEN needs to be provided either as an env variable or in ~/.elastic/github.token' unless github_token
54
-
55
- github_token
56
- end
57
-
58
48
desc 'Download test suite to ./spec/tmp'
59
49
task :download_tests do
60
50
require 'open-uri'
61
-
62
- github_token = check_for_token
63
51
path = 'spec/tmp'
64
52
filename = 'tests.zip'
65
53
url = 'https://api.github.com/repos/elastic/elasticsearch-clients-tests/zipball/main'
66
54
67
55
File . open ( filename , "w" ) do |downloaded_file |
68
56
URI . open (
69
57
url ,
70
- 'Authorization' => "Bearer #{ github_token } " ,
71
- 'Accept' => 'application/vnd.github+json' ,
58
+ 'Accept' => 'application/vnd.github+json'
72
59
) do |artifact_file |
73
60
downloaded_file . write ( artifact_file . read )
74
61
end
@@ -86,6 +73,11 @@ namespace :spec do
86
73
File . delete ( filename )
87
74
end
88
75
76
+ desc 'Clean tests folder'
77
+ task :clean_tests do
78
+ FileUtils . rm_rf ( Dir . glob ( './spec/tmp/**/*' ) , secure : true )
79
+ end
80
+
89
81
desc 'Run YAML test runner'
90
82
task :yaml do
91
83
ruby './spec/yaml-test-runner/runner.rb'
You can’t perform that action at this time.
0 commit comments