One build for two repos

Here’s my exact situation:

I have a repo called app which is currently hooked into circle ci. The app builds fine and runs our unit tests fine.

In parallel another team has been working on another repo called app-test. This repo runs selenium UI tests against localhost, staging and prod environments depending on the environment variables when the command npm test is run.

What I’d like to do is, for every commit, circleci runs the app using npm start and on the same instance, it pulls and runs npm test on the app-test repo.

Is this possible? Do I have to merge the app-test repo with app? Let alone doing this, is it even possible to run selenium tests on circle ci?

Appreciate any help!

Pretty much anything you like is possible with a Docker CI platform.

Yes.

That’s one solution, but it’s not necessary, so if it makes sense to you to keep them as separate repos, you can do that.

One simple solution (not quite what you’ve asked for, but may be fine) is to run your app-test on a schedule. I do this and run PhantomJS functional tests from PHPUnit twice a day. They take about ~9 minutes a time, so twice a day is OK without eating up my build allowance.

This is easy for every commit in app-test. If you want to do it for every commit in app then I expect you could get app-test to run app via the CircleCI.

What I’d recommend is getting Selenium working first on the app-test repo. Could you give that a bash? If you get stuck, and have made a thorough search with a search engine, then ask another question (in this thread if you wish). Remember to show your .circleci/config.yml so readers can have some context.

Hey Halfer,

Thanks for the great response. Haven’t had a chance to look at this until now. I’m going to first give running Selenium with app-test a shot and let you know if I run into any issues.

1 Like

Hey @halfer, so I tried setting up the nightly scheduled build.
Here’s my config.yml file, which I pretty much copied from https://circleci.com/docs/2.0/workflows/#scheduling-a-workflow:

version: 2
jobs:
  build:
    docker:
      - image: circleci/node:8.7.0
    steps:
      - checkout
      - run:
          name: Install NPM
          command: npm install
      - run:
          name: Test app
          command: npm test
          no_output_timeout: 1200
workflows:
  version: 2
  nightly:
    triggers:
      - schedule:
        cron: "0 0 * * *"
        filters:
          branches:
            only:
              - master
    jobs:
      - build

But in my workflows tab I see the following error:

We weren’t able to start this workflow.
Encountered errors trying to create workflows from this config: Config does not conform to schema: {:workflows {:nightly {:triggers [{:schedule (not (map? nil)), :cron disallowed-key, :filters disallowed-key}]}}}
For more examples see the Workflows documentation.

Not sure what this error means. I reviewed the syntax and confirmed that it’s exactly the same as the one in the documentation. Appreciate your help here thanks!

I can’t see anything wrong with that on first glance. To start with, I would suggest turning on invisible characters in your editor, in order to ensure you haven’t got any tabs lurking in your config file.

Hmm, I’ve double checked that there are on tabs lurking around. I’ve also ran the circleci config validate command on this file and it states that it’s valid… :confused:

Any other way to debug this?

No further ideas come to mind, sorry. See my config file here.

:(. This is pretty sad. My config file looks totally fine and the circleci seems pretty useless as it seems to validate anything. And the error message on CircleCI workflows dashboard is pretty useless too.

Sad-face emoticons and calling everything “useless” is not going to encourage volunteers like myself to keep responding to you. Keep it positive please, and keep trying something. There is always something more you can try. CI is hard, even if Circle and others make it a bit easier :slightly_smiling_face:.

(Also, maybe someone else will have some ideas for you).

Haven’t had a chance to look at this for a while. Going to review my config file again.

Sorry if my last comment discouraged you, but I believe you’re taking it too personally. Let me clarify my comment. I hope you can view this as constructive feedback.

  1. The circle CI validate tool has so far been mostly useless (I say that in the most objective, unemotional way possible). Running the validate tool does not provide any errors or information. It simply states my config is correct. However the circle CI web app clearly uses something else to validate, which I don’t have access to. That tool states my config is incorrect.

  2. The circle CI web app provides an error message, but it’s still not very clear. I still don’t know what’s wrong with my config, based on this error:

We weren’t able to start this workflow.
Encountered errors trying to create workflows from this config: Config does not conform to schema: {:workflows {:nightly {:triggers [{:schedule (not (map? nil)), :cron disallowed-key, :filters disallowed-key}]}}}

  1. The error points me to Workflows documentation, which has an example of how the scheduled workflow should look. I’ve copied exactly that and it still prints the same error.

Where do I go from here? I’m going to keep reading documentation, but your comment on my emoticons and my use of the word “useless” is unnecessary. Objectively speaking, all of the tools and errors have proven to be useless. I hope the circle CI team objectively looks at this and considers this as valid feedback. Please don’t take these comments personally. I’m simply stating facts.

Here’s my config file once again:

version: 2
jobs:
  test:
    docker:
      - image: circleci/node:8.7.0
    steps:
      - checkout
      - run:
          name: Install NPM
          command: npm install
      - run:
          name: Test app
          command: npm test
          no_output_timeout: 1200
workflows:
  version: 2
  commit:
    jobs:
      - test
  nightly:
    triggers:
      - schedule:
          cron: "0 0 * * *"
          filters:
            branches:
              only:
                - master
    jobs:
      - test

So I seemed to have fixed the issue :). Here’s literally what the diff looks like:

11%20PM

So I guess spaces matter? That’s good to know. Were you aware of this @halfer? If this was clearly mentioned in the documentation that’s my bad.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.