swh:1:snp:505c374fd75bb208ae4e9a54e64bb310bc49295e
Raw File
Tip revision: b26a075ddf2a5818566d8b2bd75d847c1b89022d authored by satos on 13 December 2021, 15:02:15 UTC
Shell: offer exception-less functions in Hex
Tip revision: b26a075
integration.yml
# Definition for the environment to run all integration tests.
# This is also used by Tezt tests.
# In general we do not have to run make, which takes a while,
# because the binaries have been produced by the build job and are
# in the cache. But if they are not, we need to build them.
# Ideally we should also check that the baker / accuser / endorser
# exist (some tests use them) but their actual name depend on the protocol.
.integration_template:
  extends:
    - .test_template
    - .template__coverage_files
  dependencies: ["build_x86_64"]
  before_script:
    - if [ ! -f tezos-node ] || [ ! -f tezos-client ] || [ ! -f tezos-codec ] || [ ! -f tezos-sandbox ]; then make; fi

# integration:proto:sandbox and integration:compiler-rejections do not
# require access to the binaries like the "true" integration tests
# below. Therefore, they do not extend the .integration_template.

integration:proto:sandbox:
  extends: .test_template
  script:
    - dune build @runtest_sandbox

integration:compiler-rejections:
  extends: .test_template
  script:
    - dune build @runtest_rejections

############################################################
## Stage: run scripts to check they are working properly  ##
############################################################

script:prepare_migration_test:
  extends: .test_template
  before_script:
    - last_proto_name=$(find src -name "proto_[0-9][0-9][0-9]_*" | awk -F'/' '{print $NF}' | sort -r | head -1)
    - last_proto_version=$(echo $last_proto_name | cut -d'_' -f2)
    - new_proto_version=$(printf "%03d" $((10#$last_proto_version + 1)))
    - make
  script:
    - ./scripts/prepare_migration_test.sh manual "next_$new_proto_version" 1

script:snapshot_alpha_and_link:
  extends: .test_template
  script:
    - last_proto_name=$(find src -name "proto_[0-9][0-9][0-9]_*" | awk -F'/' '{print $NF}' | sort -r | head -1)
    - last_proto_version=$(echo $last_proto_name | cut -d'_' -f2)
    - new_proto_version=$(printf "%03d" $((10#$last_proto_version + 1)))
    - make tezos-protocol-compiler
    - ./scripts/snapshot_alpha_and_link.sh "$new_proto_version" next
    - make
    - dune build src/proto_"$new_proto_version"_*/

############################################################
## Stage: run OCaml integration tests                     ##
############################################################

integration:sandboxes:voting:
  extends: .integration_template
  script:
    - TMP=$PWD make -f sandbox.Makefile voting_demo_noops
  artifacts:
    paths:
      - flextesa-voting-demo-noops
      - $BISECT_FILE
    expire_in: 1 day
    when: always

integration:sandboxes:acc-endorsement:
  extends: .integration_template
  script:
    - TMP=$PWD make -f sandbox.Makefile accusations_simple_double_endorsing
  artifacts:
    paths:
      - flextesa-acc-sde
      - $BISECT_FILE
    expire_in: 1 day
    when: always

integration:sandboxes:u-a-u:
  extends: .integration_template
  script:
    - TMP=$PWD make -f sandbox.Makefile user_activated_upgrade_next
    - TMP=$PWD make -f sandbox.Makefile user_activated_upgrade_alpha
  artifacts:
    paths:
      - flextesa-hard-fork
      - flextesa-hard-fork-alpha
      # FIXME https://gitlab.com/tezos/tezos/-/issues/2189
      # This job can produce corrupted coverage file
      # - $BISECT_FILE
    expire_in: 1 day
    when: always

integration:sandboxes:daemons-upgrade:
  extends: .integration_template
  script:
    - TMP=$PWD make -f sandbox.Makefile daemons_upgrade_next
    - TMP=$PWD make -f sandbox.Makefile daemons_upgrade_alpha
  artifacts:
    paths:
      - flextesa-daemons-upgrade
      - flextesa-daemons-upgrade-alpha
    expire_in: 1 day
    when: always

############################################################
## Stage: run python integration tests                    ##
############################################################

# definition for the environment to run all integration tests
# integration tests are run only on x86_64 architectures (for now)
.integration_python_template:
  extends:
    - .test_template
  needs:
    - build_x86_64
  dependencies:
    - build_x86_64
  before_script:
    # Load the environment poetry previously created in the docker image.
    # Give access to the Python dependencies/executables
    - . $HOME/.venv/bin/activate
    - mkdir tests_python/tmp
    - cd tests_python
  # python scripts don't need the _build directory
  # but only the binaries in the artifacts
  cache: {}

integration:pytest:
  extends:
    - .integration_python_template
    - .template__coverage_files
  # the number of jobs have been choosen to give jobs of maximal
  # length ~10 minutes and to accommodate the addition of new protocol
  # test suites without increasing wall time of the test stage.
  parallel: 25
  script:
    - poetry run pytest --exitfirst --prev-junit-xml test-results.xml --job $CI_NODE_INDEX/$CI_NODE_TOTAL --color=yes --log-dir=tmp "--junitxml=reports/report_${CI_NODE_INDEX}_${CI_NODE_TOTAL}.xml" --timeout 1800
  artifacts:
    paths:
      - tests_python/tmp/
      - tests_python/reports/*.xml
      - $BISECT_FILE
    reports:
      junit: tests_python/reports/*.xml
    expire_in: 7 day
    when: always

integration:pytest_examples:
  extends: .integration_python_template
  script:
    - PYTHONPATH=$PYTHONPATH:./ poetry run python examples/forge_transfer.py
    - PYTHONPATH=$PYTHONPATH:./ poetry run python examples/example.py
    - PYTHONPATH=./ poetry run pytest --exitfirst examples/test_example.py
back to top