circleci only 1 subschema matches out of 2

5.4k views Asked by At

i'm trying to create a circleci automated testing for my electron apps.
i followed the intruction from here: https://circleci.com/blog/electron-testing/
my repo: https://github.com/dhanyn10/electron-example/tree/spectron
my project folder looks like this

electron-example
|──/.circleci
|  |──config.yml
|──/bootbox
|──/project1
|──/project2

because in my project contains many applications, i need to specify which application in folder that i will test. Here's my circleci config

version: 2.1
jobs:
  build:
    working_directory: ~/electron-example/bootbox
    docker:
      - image: circleci/node:11-browsers
    steps:
      - checkout:
        path: ~/electron-example
      - run:
          name: Update NPM
          command: "sudo npm install -g npm"
      - restore_cache:
          key: dependency-cache-{{ checksum "package-lock.json" }}
      - run:
          name: Install Dependencies
          command: npm install
      - save_cache:
          key: dependency-cache-{{ checksum "package-lock.json" }}
          paths:
            - ./node_modules
      - run:
          name: Run tests
          command: npm run test

package.json

...
  "devDependencies": {
    "electron": "^11.4.3",
    "electron-builder": "^22.10.4",
    "mocha": "^8.3.2",
    "spectron": "^13.0.0"
  },
...

it return error below

#!/bin/sh -eo pipefail
# ERROR IN CONFIG FILE:
# [#/jobs/build] only 1 subschema matches out of 2
# 1. [#/jobs/build/steps/0] 0 subschemas matched instead of one
# |   1. [#/jobs/build/steps/0] extraneous key [path] is not permitted
# |   |   Permitted keys:
# |   |     - persist_to_workspace
# |   |     - save_cache
# |   |     - run
# |   |     - checkout
# |   |     - attach_workspace
# |   |     - store_test_results
# |   |     - restore_cache
# |   |     - store_artifacts
# |   |     - add_ssh_keys
# |   |     - deploy
# |   |     - setup_remote_docker
# |   |   Passed keys:
# |   |     []
# |   2. [#/jobs/build/steps/0] Input not a valid enum value
# |   |   Steps without arguments can be called as strings
# |   |     enum:
# |   |     - checkout
# |   |     - setup_remote_docker
# |   |     - add_ssh_keys
# 
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false

Exited with code exit status 1
CircleCI received exit code 1

How to solve this error?

1

There are 1 answers

1
jmunsch On

See:

A bit late here, but checkout defaults to the working_directory:

      - checkout:
        path: ~/electron-example

Should be:

      - checkout

Also I got here because of the following, trying to add the browser-tools:

workflows:
  build-and-test:
    jobs:
      - build
      - pylint
      - tslint
      - karma
      - jest
      - unit-tests
      - functional-tests:
          requires:
            - build
      - deploy:
          requires:
            - build
    orbs:
        browser-tools-blah

Should have been:

orbs:
    browser-tools-blah

workflows:
  build-and-test:
    jobs:
      - build
      - pylint
      - tslint
      - karma
      - jest
      - unit-tests
      - functional-tests:
          requires:
            - build
      - deploy:
          requires:
            - build