Skip to content

Commit 6da9783

Browse files
committed
[CI] Removes github_token code, updates to public tests repo
Adds clean tests folder
1 parent ee40292 commit 6da9783

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

Rakefile

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,17 @@ namespace :spec do
4545
t.pattern = Dir.glob('spec/**/*_spec.rb')
4646
end
4747

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-
5848
desc 'Download test suite to ./spec/tmp'
5949
task :download_tests do
6050
require 'open-uri'
61-
62-
github_token = check_for_token
6351
path = 'spec/tmp'
6452
filename = 'tests.zip'
6553
url = 'https://api.github.com/repos/elastic/elasticsearch-clients-tests/zipball/main'
6654

6755
File.open(filename, "w") do |downloaded_file|
6856
URI.open(
6957
url,
70-
'Authorization' => "Bearer #{github_token}",
71-
'Accept' => 'application/vnd.github+json',
58+
'Accept' => 'application/vnd.github+json'
7259
) do |artifact_file|
7360
downloaded_file.write(artifact_file.read)
7461
end
@@ -86,6 +73,11 @@ namespace :spec do
8673
File.delete(filename)
8774
end
8875

76+
desc 'Clean tests folder'
77+
task :clean_tests do
78+
FileUtils.rm_rf(Dir.glob('./spec/tmp/**/*'), secure: true)
79+
end
80+
8981
desc 'Run YAML test runner'
9082
task :yaml do
9183
ruby './spec/yaml-test-runner/runner.rb'

0 commit comments

Comments
 (0)