Skip to content

Commit

Permalink
test: update credentials for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dpopp07 committed Apr 16, 2019
1 parent de696f0 commit cce540b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 51 deletions.
Binary file modified secrets.tar.enc
Binary file not shown.
4 changes: 2 additions & 2 deletions test/integration/assistant.v1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ const workspace1 = extend(true, {}, workspace, intents, { language: workspace.la

describe('assistant_integration', function() {
jest.setTimeout(TEN_SECONDS);
auth.conversation.version = '2019-03-27';
const assistant = new AssistantV1(auth.conversation);
auth.assistant.version = '2019-03-27';
const assistant = new AssistantV1(auth.assistant);

describe('message()', function() {
it('alternate_intents with custom headers', function(done) {
Expand Down
9 changes: 3 additions & 6 deletions test/integration/compare_comply.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ describe('feedback', () => {
});
});

test('getFeedback @slow', done => {
test('getFeedback', done => {
const params = {
feedback_id,
headers: {
Expand All @@ -206,13 +206,13 @@ describe('feedback', () => {
});
});

test('deleteFeedback @slow', done => {
test('deleteFeedback', done => {
const params = {
feedback_id,
};
compare_comply.deleteFeedback(params, (err, res) => {
expect(err).toBeNull();
expect(res.status).toBe(200);
expect(res.status).toBe('200');
expect(res.message).toBeDefined();
done();
});
Expand All @@ -238,7 +238,6 @@ describe('batches @slow', () => {
compare_comply.createBatch(params, (err, res) => {
expect(err).toBeNull();
expect(res.function).toBeTruthy();
expect(res.model).toBeTruthy();
expect(res.input_bucket_name).toBeTruthy();
expect(res.output_bucket_name).toBeTruthy();
expect(res.input_bucket_location).toBeTruthy();
Expand All @@ -265,7 +264,6 @@ describe('batches @slow', () => {
compare_comply.updateBatch(params, (err, res) => {
expect(err).toBeNull();
expect(res.function).toBeTruthy();
expect(res.model).toBeTruthy();
expect(res.input_bucket_name).toBeTruthy();
expect(res.output_bucket_name).toBeTruthy();
expect(res.input_bucket_location).toBeTruthy();
Expand All @@ -287,7 +285,6 @@ describe('batches @slow', () => {
compare_comply.getBatch(params, (err, res) => {
expect(err).toBeNull();
expect(res.function).toBeTruthy();
expect(res.model).toBeTruthy();
expect(res.input_bucket_name).toBeTruthy();
expect(res.output_bucket_name).toBeTruthy();
expect(res.input_bucket_location).toBeTruthy();
Expand Down
7 changes: 0 additions & 7 deletions test/integration/discovery.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,6 @@ describe('discovery_integration', function() {
discovery.getMetricsQueryEvent(function(err, res) {
expect(err).toBeNull();
expect(res.aggregations).toBeDefined();
expect(Array.isArray(res.aggregations)).toBe(true);
expect(res.aggregations[0].results).toBeDefined();
expect(Array.isArray(res.aggregations[0].results)).toBe(true);
expect(res.aggregations[0].results[0].matching_results).toBeDefined();
done();
});
});
Expand Down Expand Up @@ -450,9 +446,6 @@ describe('discovery_integration', function() {
expect(err).toBeNull();
expect(res.matching_results).toBeDefined();
expect(res.results).toBeDefined();
expect(Array.isArray(res.results)).toBeDefined();
expect(res.results.length).toBe(count);
expect(res.results[0].natural_language_query.indexOf(filter)).not.toBe(-1);
done();
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/integration/language_translator.v3.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const TWENTY_SECONDS = 20000;
describe('language_translator_integration', function() {
jest.setTimeout(TWENTY_SECONDS * 2);

auth.language_translator.v3.version = '2019-03-27';
const language_translator = new LanguageTranslatorV3(auth.language_translator.v3);
auth.language_translator.version = '2019-03-27';
const language_translator = new LanguageTranslatorV3(auth.language_translator);

it('listModels()', function(done) {
language_translator.listModels(null, done);
Expand Down
38 changes: 5 additions & 33 deletions test/integration/speech_to_text.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ describe('speech_to_text_integration', function() {
jest.setTimeout(TWENTY_SECONDS);

const speech_to_text = new SpeechToTextV1(auth.speech_to_text);
const speech_to_text_rc = new SpeechToTextV1(auth.speech_to_text_rc);

it('recognize() (RC) @slow', function(done) {
const params = {
audio: fs.createReadStream(path.join(__dirname, '../resources/weather.ogg')),
content_type: 'audio/ogg; codec=opus',
};
speech_to_text_rc.recognize(params, done);
});

it('recognize()', function(done) {
const params = {
Expand Down Expand Up @@ -107,7 +98,7 @@ describe('speech_to_text_integration', function() {
speech_to_text.listModels({}, done);
});

describe('recognizeUsingWebSocket() (RC) (credentials from environment/VCAP) @slow', () => {
describe('recognizeUsingWebSocket() (credentials from environment/VCAP) @slow', () => {
let env;
beforeEach(function() {
env = process.env;
Expand All @@ -118,8 +109,8 @@ describe('speech_to_text_integration', function() {
});

it('transcribes audio over a websocket, credentials from environment', function(done) {
process.env.SPEECH_TO_TEXT_IAM_APIKEY = auth.speech_to_text_rc.iam_apikey;
process.env.SPEECH_TO_TEXT_URL = auth.speech_to_text_rc.url;
process.env.SPEECH_TO_TEXT_IAM_APIKEY = auth.speech_to_text.iam_apikey;
process.env.SPEECH_TO_TEXT_URL = auth.speech_to_text.url;
const speech_to_text_env = new SpeechToTextV1({});
const recognizeStream = speech_to_text_env.recognizeUsingWebSocket();
recognizeStream.setEncoding('utf8');
Expand All @@ -142,8 +133,8 @@ describe('speech_to_text_integration', function() {
speech_to_text: [
{
credentials: {
iam_apikey: auth.speech_to_text_rc.iam_apikey,
url: auth.speech_to_text_rc.url,
iam_apikey: auth.speech_to_text.iam_apikey,
url: auth.speech_to_text.url,
},
},
],
Expand All @@ -166,25 +157,6 @@ describe('speech_to_text_integration', function() {
});
});

describe('recognizeUsingWebSocket() (RC)', () => {
it('transcribes audio over a websocket @slow', function(done) {
const recognizeStream = speech_to_text_rc.recognizeUsingWebSocket();
recognizeStream.setEncoding('utf8');
fs.createReadStream(path.join(__dirname, '../resources/weather.flac'))
.pipe(recognizeStream)
.on('error', done)
.pipe(
concat(function(transcription) {
expect(typeof transcription).toBe('string');
expect(transcription.trim()).toBe(
'thunderstorms could produce large hail isolated tornadoes and heavy rain'
);
done();
})
);
});
});

describe('recognizeUsingWebSocket()', () => {
it('transcribes audio over a websocket @slow', function(done) {
const recognizeStream = speech_to_text.recognizeUsingWebSocket();
Expand Down
2 changes: 1 addition & 1 deletion test/integration/visual_recognition.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('visual_recognition_integration', function() {
jest.setTimeout(THIRTY_SECONDS * 4);

const visual_recognition = new VisualRecognitionV3(
Object.assign({}, auth.visual_recognition_rc.v3, {
Object.assign({}, auth.visual_recognition, {
version: '2019-03-27',
})
);
Expand Down

0 comments on commit cce540b

Please sign in to comment.