我创建了 public-repo 来测试 private-repo .

我在private-repo和public-repo上有相同的配置:

{
      "os": "linux",
      "env": "BUNDLE_GEMS__CONTRIBSYS__COM=1234567890",
      "dist": "trusty",
      "cache": {
        "bundler": true,
        yarn: true,
        "directories": [
          "~/.cache"
        ]
      },
      "group": "stable",
      "addons": {
        "postgresql": "9.4"
      },
      "script": [
        "$(yarn bin)/cypress run"
      ],
      "install": [
        "yarn add cypress"
      ],
      "node_js": 10,
      "language": "node_js",
      "services": [
        "redis-server",
        "postgresql"
      ],
      "before_script": [
        "rails server -p 3000 -b 127.0.0.1 &",
        "psql -c 'create database travis_ci_test;' -U postgres",
        "RAILS_ENV=test bundle exec rake db:schema:load",
        "RAILS_ENV=test bundle exec rake db:seed"
      ],
      "before_install": [
        "gem install bundler",
        "bundle install"
      ]
    }

但我不明白为什么我的私人仓库中出现此错误消息:

Testing
        1) can i access to 127.0.0.1
        2) can i access to localhost
      0 passing (1m)
      2 failing
      1) Testing can i access to 127.0.0.1:
         CypressError: cy.request() timed out waiting 30000ms for a response from your server.
    The request we sent was:
    Method: GET
    URL: http://127.0.0.1:3000/
    No response was received within the timeout.
          at Object.cypressErr (http://localhost:36431/__cypress/runner/cypress_runner.js:68076:11)
          at Object.throwErr (http://localhost:36431/__cypress/runner/cypress_runner.js:68041:18)
          at Object.throwErrByPath (http://localhost:36431/__cypress/runner/cypress_runner.js:68068:17)
          at http://localhost:36431/__cypress/runner/cypress_runner.js:59657:25
          at tryCatcher (http://localhost:36431/__cypress/runner/cypress_runner.js:7091:23)
          at http://localhost:36431/__cypress/runner/cypress_runner.js:2408:41
          at tryCatcher (http://localhost:36431/__cypress/runner/cypress_runner.js:7091:23)
          at Promise._settlePromiseFromHandler (http://localhost:36431/__cypress/runner/cypress_runner.js:5113:31)
          at Promise._settlePromise (http://localhost:36431/__cypress/runner/cypress_runner.js:5170:18)
          at Promise._settlePromise0 (http://localhost:36431/__cypress/runner/cypress_runner.js:5215:10)
          at Promise._settlePromises (http://localhost:36431/__cypress/runner/cypress_runner.js:5290:18)
          at Async._drainQueue (http://localhost:36431/__cypress/runner/cypress_runner.js:2023:16)
          at Async._drainQueues (http://localhost:36431/__cypress/runner/cypress_runner.js:2033:10)
          at Async.drainQueues (http://localhost:36431/__cypress/runner/cypress_runner.js:1907:14)
          at

我的公开回购:https://github.com/joffreyBerrier/rails-travis

我的公共travis建设:https://travis-ci.org/joffreyBerrier/rails-travis/builds

我的赛普拉斯测试:

describe('Testing', () => {
      it('can i access to 127.0.0.1', () => {
        cy.request('http://127.0.0.1:3000');
      });

      it('can i access to localhost', () => {
        cy.request('localhost:3000');
      });
    });