<commit_before>require 'serverspec'

# Required by serverspec
set :backend, :exec

describe file('/home/_mig/.bashrc') do
  its(:content) { should match /GOPATH/ }
end
describe file('/home/_mig/.migrc'), :if => os[:family] == 'ubuntu' && os[:release] == '14.04' do
  its(:content) { should match /keyid/ }
end
describe file('/home/_mig/.migrc'), :if => os[:family] == 'ubuntu' && os[:release] == '16.04' do
  its(:content) { should match /keyid/ }
end

### For some reason, stalling when called by serverspec. fine in CLI. mig has some progress bar that might affect / no way to disable it currently.
### time less than 1sec
#describe command('/home/_mig/go/src/github.com/mozilla/mig/bin/linux/amd64/mig-agent-search -c ~/.migrc "name like \'%%\'"') do
#  let(:sudo_options) { '-u mig -H' }
#  its(:stdout) { should match /online;/ }
#end
### time ~5min
#describe command('/home/_mig/go/src/github.com/mozilla/mig/bin/linux/amd64/mig -i /home/_mig/go/src/github.com/mozilla/mig/actions/integration_tests.json | tee /tmp/integration_tests.out') do
#  let(:sudo_options) { '-u mig -H' }
#  its(:stdout) { should match /0 agent has found results/ }
#end
<commit_msg>test serverspec: disable keyid migrc check for ubuntu 16.04<commit_after>require 'serverspec'

# Required by serverspec
set :backend, :exec

describe file('/home/_mig/.bashrc') do
  its(:content) { should match /GOPATH/ }
end
#describe file('/home/_mig/.migrc'), :if => os[:family] == 'ubuntu' && os[:release] == '14.04' do
#  its(:content) { should match /keyid/ }
#end
#describe file('/home/_mig/.migrc'), :if => os[:family] == 'ubuntu' && os[:release] == '16.04' do
#  its(:content) { should match /keyid/ }
#end
describe file('/home/_mig/.migrc'), :if => os[:family] == 'ubuntu' && os[:release] == '18.04' do
  its(:content) { should match /keyid/ }
end

### For some reason, stalling when called by serverspec. fine in CLI. mig has some progress bar that might affect / no way to disable it currently.
### time less than 1sec
#describe command('/home/_mig/go/src/github.com/mozilla/mig/bin/linux/amd64/mig-agent-search -c ~/.migrc "name like \'%%\'"') do
#  let(:sudo_options) { '-u mig -H' }
#  its(:stdout) { should match /online;/ }
#end
### time ~5min
#describe command('/home/_mig/go/src/github.com/mozilla/mig/bin/linux/amd64/mig -i /home/_mig/go/src/github.com/mozilla/mig/actions/integration_tests.json | tee /tmp/integration_tests.out') do
#  let(:sudo_options) { '-u mig -H' }
#  its(:stdout) { should match /0 agent has found results/ }
#end

{'fraction_non_alphanumeric': 0.18715305313243458, 'fraction_numerical': 0.01506740681998414, 'mean_word_length': 4.005952380952381, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6263920', 'n_tokens_mistral': 951, 'n_tokens_neox': 888, 'n_words': 239}