stages: - build_and_run_automated_test_scenarios_with_preinstalled_image - build_and_test_with_preinstalled_image - build_and_test_with_debian_image build_and_test_with_preinstalled_image: stage: build_and_test_with_preinstalled_image # Image glondu/beleniosbase:YYYYMMDD-N is built by Dockerfile_base_environment image: glondu/beleniosbase:20181206-2 script: # Initialize environment - source ~/env.sh # Compile belenios - BELENIOS_DEBUG=1 make all # Create a bundled version of belenios (this produces a belenios.tar.gz file, which is needed by the web server) - make archive # Start belenios web server - ./demo/run-server.sh & # Access the localhost web page, print page output for debug purposes, and check validity of page output - first_access_index_page_output=$(wget --retry-connrefused --no-check-certificate -T 30 http://localhost:8001 -O-) - echo $first_access_index_page_output - if [ "$(echo \"$first_access_index_page_output\" | grep '>Belenios' | wc -l)" != "1" ]; then echo "[First page access] First page access does not show a single '>Belenios' text, but it should" && exit 1; else echo "[First page access] First page access shows a single '>Belenios' text, as expected"; fi # Run a test of an election - BELENIOS_DEBUG=1 make check build_and_test_with_debian_image: stage: build_and_test_with_debian_image # Image ocaml/opam2:debian-9-ocaml-4.06 currently has ocaml version 4.06.1 and opam version 2.0.0 (whereas image ocaml/opam2:debian-9 currently has ocaml version 4.07.0) image: ocaml/opam2:debian-9-ocaml-4.06 script: # Install required packages - sudo apt-get update -qq && sudo apt-get install -y -qq build-essential libgmp-dev libpcre3-dev pkg-config m4 libssl-dev libsqlite3-dev wget ca-certificates unzip aspcud libncurses-dev uuid-runtime zlib1g-dev # Install the same Opam packages that opam-bootstrap.sh installs - eval `grep "opam install" ./opam-bootstrap.sh` # Compile belenios - BELENIOS_DEBUG=1 make all # Create a bundled version of belenios (this produces a belenios.tar.gz file, which is needed by the web server) - make archive # Start belenios web server - ./demo/run-server.sh & # Access the localhost web page, print page output for debug purposes, and check validity of page output - first_access_index_page_output=$(wget --retry-connrefused --no-check-certificate -T 30 http://localhost:8001 -O-) - echo $first_access_index_page_output - if [ "$(echo \"$first_access_index_page_output\" | grep '>Belenios' | wc -l)" != "1" ]; then echo "[First page access] First page access does not show a single '>Belenios' text, but it should" && exit 1; else echo "[First page access] First page access shows a single '>Belenios' text, as expected"; fi # Run a test of an election # - BELENIOS_DEBUG=1 make check build_and_run_automated_test_scenarios_with_preinstalled_image: stage: build_and_run_automated_test_scenarios_with_preinstalled_image # Image glondu/beleniosbase-tests:YYYYMMDD-N is built by Dockerfile_test_scenario_environment image: glondu/beleniosbase-tests:20181206-2 script: # Initialize environment - source ~/env.sh # Compile belenios - BELENIOS_DEBUG=1 make all # Create a bundled version of belenios (this produces a belenios.tar.gz file, which is needed by the web server) - make archive # We don't need to start belenios web server, as it will be started by the automated test # - ./demo/run-server.sh & # Create a Python 3 virtual environment, where pip packages will be installed - python3 -m venv venv # Step into this new virtual environment - source venv/bin/activate # Install pip packages - pip install -r requirements.txt # Run the automated test scenario 4 - python3 ./tests/test_scenario_4.py # Run the automated test scenario 2 - python3 ./tests/test_scenario_2.py # Run the automated test scenario 1 - python3 ./tests/test_scenario_1.py