Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] [Plugin Generator] Add integration test (#43219) #45044

Merged
merged 8 commits into from
Sep 11, 2019

Conversation

wayneseymour
Copy link
Member

Backports the following commits to 7.x:

Addresses elastic#17061

### Features Covered 
 - generating a plugin

#### Then from within the generated plugin's directory
 - running `yarn build`
 - running `yarn test:browser`
 - running `yarn test:server`
 - running `yarn start`
 - running `yarn preinstall`
 - running `yarn lint`
 - running `yarn kbn --help`
 - running `yarn es --help`
@wayneseymour wayneseymour self-assigned this Sep 6, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

@wayneseymour
Copy link
Member Author

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@wayneseymour
Copy link
Member Author

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@wayneseymour
Copy link
Member Author

wayneseymour commented Sep 10, 2019

Finally ssh'd into a worker and ran a focused, failing test w/o cleaning up the generated plugin (commented that out), and this is the test output:

 FAIL  packages/kbn-plugin-generator/integration_tests/generate_plugin.test.js (106.442s)
  running the plugin-generator via 'node scripts/generate_plugin.js plugin-name' with default config
    ○ skipped should succeed on creating a plugin in a directory named 'plugins/ispec_plugin
    then running
      ✕ 'yarn start' should result in the spec plugin being initialized on kibana's stdout (35558ms)
      ○ skipped 'yarn test:browser' should exit 0
      ○ skipped 'yarn test:server' should exit 0
      ○ skipped 'yarn build' should exit 0
      ○ skipped 'yarn preinstall' should exit 0
      ○ skipped 'yarn lint' should exit 0
      ○ skipped 'yarn kbn --help' should print out the kbn help msg
      ○ skipped 'yarn es --help' should print out the es help msg

  ● running the plugin-generator via 'node scripts/generate_plugin.js plugin-name' with default config › then running › 'yarn start' should result in the spec plugin being initialized on kibana's stdout

    ES exited with code 1

      19 |
      20 | exports.createCliError = function(message) {
    > 21 |   const error = new Error(message);
         |                 ^
      22 |   error.isCliError = true;
      23 |   return error;
      24 | };

      at Object.<anonymous>.exports.createCliError (packages/kbn-es/src/errors.js:21:17)
      at createCliError (packages/kbn-es/src/cluster.js:330:15)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 8 skipped, 9 total
Snapshots:   0 total
Time:        108.01s, estimated 141s
Ran all test suites matching /packages\/kbn-plugin-generator\/integration_tests\/generate_plugin.test.js/i.

This is the generated intl file

[jenkins@kibana-ci-immutable-centos-1568133107115144507 kibana]$ cat plugins/ispec_plugin/.i18nrc.json
{
  "paths": {
    "ispecPlugin": "./"
  }
}

I wonder 2 things now:

  1. Is the intl file contents correct?
  2. Is the intl file causing this error: ES exited with code 1

So, I just ran the same setup, but against master and the file content is indeed different:

{
  "paths": {
    "ispecPlugin": "./"
  },
  "translations": [
    "translations/zh-CN.json"
  ]
}

I'll try pasting this into the worker I'm ssh'd into and see what the test reports.

I just ran the tests w/o re-generating the plugin to ensure the copy-pasta'd intl file was not generated differently, and we still have 4 failing tests:

  1. ✕ 'yarn test:browser' should exit 0 (71142ms)
  2. ✕ 'yarn start' should result in the spec plugin being initialized on kibana's stdout (26187ms)
  3. ✕ 'yarn kbn --help' should print out the kbn help msg (16ms)
  4. ✕ 'yarn es --help' should print out the es help msg (13ms)

@elasticmachine
Copy link
Contributor

💔 Build Failed

@wayneseymour
Copy link
Member Author

CI Log Snippet of the errors:

11:17:33  PASS  src/cli/serve/integration_tests/reload_logging_config.test.js (33.511s)
11:19:53  FAIL  packages/kbn-plugin-generator/integration_tests/generate_plugin.test.js (140.137s)
11:19:53   ● running the plugin-generator via 'node scripts/generate_plugin.js plugin-name' with default config › then running › 'yarn test:browser' should exit 0
11:19:53 
11:19:53     Command failed: yarn test:browser
11:19:53     warning package.json: No license field
11:19:53     (node:7064) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
11:19:53 
11:19:53      FATAL  Error: Failed to parse .i18nrc.json file at /var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/intake/node/linux-immutable/kibana/plugins/ispec_plugin/.i18nrc.json
11:19:53 
11:19:53     error Command failed with exit code 3.
11:19:53     Task "testBrowser" failed:
11:19:53 
11:19:53     Error: Command failed: yarn test:browser --kbnServer.plugin-path=/var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/intake/node/linux-immutable/kibana/plugins/ispec_plugin --kbnServer.tests_bundle.pluginId=ispec_plugin
11:19:53 
11:19:53       34 |   const task = options.dev ? 'test:dev' : 'test:browser';
11:19:53       35 |   const args = [task].concat(kbnServerArgs);
11:19:53     > 36 |   execFileSync(winCmd('yarn'), args, {
11:19:53          |   ^
11:19:53       37 |     cwd: plugin.kibanaRoot,
11:19:53       38 |     stdio: ['ignore', 1, 2],
11:19:53       39 |   });
11:19:53 
11:19:53       at testBrowserAction (packages/kbn-plugin-helpers/tasks/test/browser/test_browser_action.js:36:3)
11:19:53       at run (packages/kbn-plugin-helpers/lib/run.js:30:10)
11:19:53       at Command.<anonymous> (packages/kbn-plugin-helpers/lib/commander_action.js:27:13)
11:19:53       at Command.listener (packages/kbn-plugin-helpers/node_modules/commander/index.js:315:8)
11:19:53       at Command.parseArgs (packages/kbn-plugin-helpers/node_modules/commander/index.js:654:12)
11:19:53       at Command.parse (packages/kbn-plugin-helpers/node_modules/commander/index.js:474:21)
11:19:53       at Object.<anonymous> (packages/kbn-plugin-helpers/cli.js:93:9)
11:19:53       error Command failed with exit code 1.
11:19:53       $ plugin-helpers test:browser
11:19:53       $ grunt test:browser --kbnServer.plugin-path=/var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/intake/node/linux-immutable/kibana/plugins/ispec_plugin --kbnServer.tests_bundle.pluginId=ispec_plugin
11:19:53       Running "checkPlugins" task
11:19:53       >> ===================================================================================================
11:19:53       >> The ispec_plugin plugin may disrupt the test process. Consider removing it and re-running your tests.
11:19:53       >> ===================================================================================================
11:19:53       Running "run:browserSCSS" (run) task
11:19:53         log   [17:18:52.017] [warning][plugins-discovery] Explicit plugin paths [/var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/intake/node/linux-immutable/kibana/plugins/ispec_plugin] are only supported in development. Relative imports will not work in production.
11:19:53         log   [17:18:52.095] [info][plugins-service] Plugin initialization disabled.
11:19:53         log   [17:18:53.902] [fatal][root] Error: Failed to parse .i18nrc.json file at /var/lib/jenkins/workspace/elastic+kibana+pull-request/JOB/intake/node/linux-immutable/kibana/plugins/ispec_plugin/.i18nrc.json
11:19:53       at getTranslationPaths (src/legacy/server/i18n/get_translations_path.js:42:13)
11:19:53       Warning: non-zero exit code 1� Use --force to continue.
11:19:53       Aborted due to warnings.
11:19:53       info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
11:19:53       info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
11:19:53       at makeError (node_modules/execa/index.js:174:9)
11:19:53       at Promise.all.then.arr (node_modules/execa/index.js:278:16)
11:19:53 
11:19:53   ● running the plugin-generator via 'node scripts/generate_plugin.js plugin-name' with default config › then running › 'yarn start' should result in the spec plugin being initialized on kibana's stdout
11:19:53 
11:19:53     EmptyError: no elements in sequence
11:19:53 
11:19:53       at new EmptyError (node_modules/rxjs/src/internal/util/EmptyError.ts:16:5)
11:19:53       at node_modules/rxjs/src/internal/operators/first.ts:68:73
11:19:53       at Object.complete (node_modules/rxjs/src/internal/operators/throwIfEmpty.ts:36:15)
11:19:53       at TapSubscriber.Object.<anonymous>.TapSubscriber._complete (node_modules/rxjs/src/internal/operators/tap.ts:131:25)
11:19:53       at TapSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at TakeSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at TakeSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at FilterSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at FilterSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at RefCountSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at RefCountSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at Subject.Object.<anonymous>.Subject.complete (node_modules/rxjs/src/internal/Subject.ts:92:15)
11:19:53       at ConnectableSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at ConnectableSubscriber.Object.<anonymous>.ConnectableSubscriber._complete (node_modules/rxjs/src/internal/observable/ConnectableObservable.ts:86:20)
11:19:53       at ConnectableSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at TapSubscriber.Object.<anonymous>.TapSubscriber._complete (node_modules/rxjs/src/internal/operators/tap.ts:136:29)
11:19:53       at TapSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at MergeMapSubscriber.Object.<anonymous>.MergeMapSubscriber.notifyComplete (node_modules/rxjs/src/internal/operators/mergeMap.ts:165:24)
11:19:53       at InnerSubscriber.Object.<anonymous>.InnerSubscriber._complete (node_modules/rxjs/src/internal/InnerSubscriber.ts:26:17)
11:19:53       at InnerSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at MergeMapSubscriber.Object.<anonymous>.MergeMapSubscriber.notifyComplete (node_modules/rxjs/src/internal/operators/mergeMap.ts:165:24)
11:19:53       at InnerSubscriber.Object.<anonymous>.InnerSubscriber._complete (node_modules/rxjs/src/internal/InnerSubscriber.ts:26:17)
11:19:53       at InnerSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at CatchSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at CatchSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at MergeMapSubscriber.Object.<anonymous>.MergeMapSubscriber._complete (node_modules/rxjs/src/internal/operators/mergeMap.ts:148:24)
11:19:53       at MergeMapSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at TapSubscriber.Object.<anonymous>.TapSubscriber._complete (node_modules/rxjs/src/internal/operators/tap.ts:136:29)
11:19:53       at TapSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at TakeLastSubscriber.Object.<anonymous>.TakeLastSubscriber._complete (node_modules/rxjs/src/internal/operators/takeLast.ts:109:17)
11:19:53       at TakeLastSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at RefCountSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at RefCountSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at Subject.Object.<anonymous>.Subject.complete (node_modules/rxjs/src/internal/Subject.ts:92:15)
11:19:53       at ConnectableSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at ConnectableSubscriber.Object.<anonymous>.ConnectableSubscriber._complete (node_modules/rxjs/src/internal/observable/ConnectableObservable.ts:86:20)
11:19:53       at ConnectableSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at TakeUntilSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at TakeUntilSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at TakeUntilSubscriber.Object.<anonymous>.TakeUntilSubscriber.notifyNext (node_modules/rxjs/src/internal/operators/takeUntil.ts:81:10)
11:19:53       at InnerSubscriber.Object.<anonymous>.InnerSubscriber._next (node_modules/rxjs/src/internal/InnerSubscriber.ts:17:17)
11:19:53       at InnerSubscriber.Object.<anonymous>.Subscriber.next (node_modules/rxjs/src/internal/Subscriber.ts:102:12)
11:19:53       at MaterializeSubscriber.Object.<anonymous>.MaterializeSubscriber._complete (node_modules/rxjs/src/internal/operators/materialize.ts:88:17)
11:19:53       at MaterializeSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at RefCountSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at RefCountSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at Subject.Object.<anonymous>.Subject.complete (node_modules/rxjs/src/internal/Subject.ts:92:15)
11:19:53       at ConnectableSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at ConnectableSubscriber.Object.<anonymous>.ConnectableSubscriber._complete (node_modules/rxjs/src/internal/observable/ConnectableObservable.ts:86:20)
11:19:53       at ConnectableSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at RaceSubscriber.Object.<anonymous>.OuterSubscriber.notifyComplete (node_modules/rxjs/src/internal/OuterSubscriber.ts:21:22)
11:19:53       at InnerSubscriber.Object.<anonymous>.InnerSubscriber._complete (node_modules/rxjs/src/internal/InnerSubscriber.ts:26:17)
11:19:53       at InnerSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at IgnoreElementsSubscriber.Object.<anonymous>.Subscriber._complete (node_modules/rxjs/src/internal/Subscriber.ts:151:22)
11:19:53       at IgnoreElementsSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at TapSubscriber.Object.<anonymous>.TapSubscriber._complete (node_modules/rxjs/src/internal/operators/tap.ts:136:29)
11:19:53       at TapSubscriber.Object.<anonymous>.Subscriber.complete (node_modules/rxjs/src/internal/Subscriber.ts:129:12)
11:19:53       at TakeSubscriber.Object.<anonymous>.TakeSubscriber._next (node_modules/rxjs/src/internal/operators/take.ts:84:26)
11:19:53       at TakeSubscriber.Object.<anonymous>.Subscriber.next (node_modules/rxjs/src/internal/Subscriber.ts:102:12)
11:19:53       at Socket.handler (node_modules/rxjs/src/internal/observable/fromEvent.ts:197:20)
11:19:53 
11:19:55 (node:6196) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit

@elasticmachine
Copy link
Contributor

💔 Build Failed

Add blank line ending.
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@wayneseymour wayneseymour merged commit 86a1f7b into elastic:7.x Sep 11, 2019
@wayneseymour wayneseymour deleted the backport/7.x/pr-43219 branch September 11, 2019 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants