【问题标题】:How to setup circleci tests for algorand sandbox project?如何为algorand沙箱项目设置circleci测试?
【发布时间】:2022-02-17 23:31:35
【问题描述】:

我正在使用 NodeJS 脚本开发一个 algorand 项目,并使用沙箱进行开发。

注意:我们还使用了 algorand indexer 和沙盒,但没有合约。

出于开发目的,我们可以使用 jest 轻松进行测试,但是当我尝试使用 circle CI 自动化它时,它在测试阶段失败了。

这是我的 .circleci/config.yml 文件::

version: 2.1

orbs:
  node: circleci/node@5.0.0

jobs:
  build:
    docker:
      - image: cimg/node:17.5.0
    steps:
      - checkout
      - run: echo "build project"
      - run: npm install
      - run: npm run build
  linting:
    docker:
      - image: cimg/node:17.5.0
    steps:
      - checkout
      - run: echo "Linting project"
      - run: npm install
      - run: npm run lint
  test:
    docker:
      - image: cimg/node:17.5.0
    steps:
      - checkout
      - run: echo "Running tests"
      - run: npm install
      - run: npm run test

workflows:
  test_build:
    jobs:
      - linting
      - build
      - test:
          requires:
            - build

我该如何解决这个问题?

【问题讨论】:

    标签: node.js config circleci


    【解决方案1】:

    Algorand 沙箱 (https://github.com/algorand/sandbox) 本身使用 Docker 和 docker-compose。因此,它不能轻易地直接在另一个 docker 容器中使用。

    你可以在那里看到一个讨论: https://github.com/algorand/sandbox/issues/84

    从那里你有两个选择:

    1. 在 Circle CI 中使用机器执行器而不是 docker 执行器:https://circleci.com/docs/2.0/executor-types/ / https://circleci.com/docs/2.0/docker-to-machine/。这使您可以访问 docker 并运行沙箱。
    2. 由于沙盒只是 https://github.com/algorand/go-algorandhttps://github.com/algorand/indexer 的包装,因此您可以手动提取这部分并在没有沙盒的情况下运行节点进行测试。

    PS:一般来说,我建议在https://forum.algorand.org 上询问与 Algorand 相关的问题,对于此类问题,这比 stackoverflow 更活跃。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-22
      • 2017-06-19
      • 1970-01-01
      • 2014-05-25
      • 1970-01-01
      • 2013-09-15
      相关资源
      最近更新 更多