Skip to content

Commit

Permalink
Fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang committed Jun 25, 2020
1 parent b9f0ddb commit 2e0eaf0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('Ingest Manager - validateDatasource()', () => {
streams: [
{
id: 'foo-foo',
dataset: { name: 'foo' },
dataset: { name: 'foo', type: 'logs' },
enabled: true,
vars: { 'var-name': { value: 'test_yaml: value', type: 'yaml' } },
},
Expand All @@ -174,13 +174,13 @@ describe('Ingest Manager - validateDatasource()', () => {
streams: [
{
id: 'bar-bar',
dataset: { name: 'bar' },
dataset: { name: 'bar', type: 'logs' },
enabled: true,
vars: { 'var-name': { value: 'test_yaml: value', type: 'yaml' } },
},
{
id: 'bar-bar2',
dataset: { name: 'bar2' },
dataset: { name: 'bar2', type: 'logs' },
enabled: true,
vars: { 'var-name': { value: undefined, type: 'text' } },
},
Expand All @@ -197,13 +197,13 @@ describe('Ingest Manager - validateDatasource()', () => {
streams: [
{
id: 'with-disabled-streams-disabled',
dataset: { name: 'disabled' },
dataset: { name: 'disabled', type: 'logs' },
enabled: false,
vars: { 'var-name': { value: undefined, type: 'text' } },
},
{
id: 'with-disabled-streams-disabled-without-vars',
dataset: { name: 'disabled2' },
dataset: { name: 'disabled2', type: 'logs' },
enabled: false,
},
],
Expand All @@ -217,7 +217,7 @@ describe('Ingest Manager - validateDatasource()', () => {
streams: [
{
id: 'with-no-stream-vars-bar',
dataset: { name: 'bar' },
dataset: { name: 'bar', type: 'logs' },
enabled: true,
},
],
Expand All @@ -240,7 +240,7 @@ describe('Ingest Manager - validateDatasource()', () => {
streams: [
{
id: 'foo-foo',
dataset: { name: 'foo' },
dataset: { name: 'foo', type: 'logs' },
enabled: true,
vars: { 'var-name': { value: 'invalidyaml: test\n foo bar:', type: 'yaml' } },
},
Expand All @@ -256,13 +256,13 @@ describe('Ingest Manager - validateDatasource()', () => {
streams: [
{
id: 'bar-bar',
dataset: { name: 'bar' },
dataset: { name: 'bar', type: 'logs' },
enabled: true,
vars: { 'var-name': { value: ' \n\n', type: 'yaml' } },
},
{
id: 'bar-bar2',
dataset: { name: 'bar2' },
dataset: { name: 'bar2', type: 'logs' },
enabled: true,
vars: { 'var-name': { value: undefined, type: 'text' } },
},
Expand All @@ -279,7 +279,7 @@ describe('Ingest Manager - validateDatasource()', () => {
streams: [
{
id: 'with-disabled-streams-disabled',
dataset: { name: 'disabled' },
dataset: { name: 'disabled', type: 'logs' },
enabled: false,
vars: {
'var-name': {
Expand All @@ -290,7 +290,7 @@ describe('Ingest Manager - validateDatasource()', () => {
},
{
id: 'with-disabled-streams-disabled-without-vars',
dataset: { name: 'disabled2' },
dataset: { name: 'disabled2', type: 'logs' },
enabled: false,
},
],
Expand All @@ -304,7 +304,7 @@ describe('Ingest Manager - validateDatasource()', () => {
streams: [
{
id: 'with-no-stream-vars-bar',
dataset: { name: 'bar' },
dataset: { name: 'bar', type: 'logs' },
enabled: true,
},
],
Expand Down
10 changes: 6 additions & 4 deletions x-pack/plugins/ingest_manager/server/services/datasource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe('Datasource service', () => {
({
datasets: [
{
type: 'logs',
name: 'package.dataset1',
streams: [{ input: 'log', template_path: 'some_template_path.yml' }],
},
Expand All @@ -61,7 +62,7 @@ describe('Datasource service', () => {
streams: [
{
id: 'dataset01',
dataset: { name: 'package.dataset1' },
dataset: { name: 'package.dataset1', type: 'logs' },
enabled: true,
vars: {
paths: {
Expand All @@ -81,7 +82,7 @@ describe('Datasource service', () => {
streams: [
{
id: 'dataset01',
dataset: { name: 'package.dataset1' },
dataset: { name: 'package.dataset1', type: 'logs' },
enabled: true,
vars: {
paths: {
Expand All @@ -105,6 +106,7 @@ describe('Datasource service', () => {
datasets: [
{
name: 'package.dataset1',
type: 'logs',
streams: [{ input: 'log', template_path: 'some_template_path.yml' }],
},
],
Expand All @@ -126,7 +128,7 @@ describe('Datasource service', () => {
streams: [
{
id: 'dataset01',
dataset: { name: 'package.dataset1' },
dataset: { name: 'package.dataset1', type: 'logs' },
enabled: true,
},
],
Expand All @@ -146,7 +148,7 @@ describe('Datasource service', () => {
streams: [
{
id: 'dataset01',
dataset: { name: 'package.dataset1' },
dataset: { name: 'package.dataset1', type: 'logs' },
enabled: true,
agent_stream: {
metricset: ['dataset1'],
Expand Down

0 comments on commit 2e0eaf0

Please sign in to comment.