Commit 183a9125 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Merging integration tests into buildstream proper.

This fixes #96
parent f613e732
Pipeline #12798968 passed with stages
in 33 minutes and 4 seconds
......@@ -13,3 +13,6 @@ tests/**/*.pyc
tmp
.coverage
.cache
# Integration test results
/integration-tests/*results/
......@@ -37,13 +37,12 @@ integration_linux:
script:
- pip3 install .
- git clone https://gitlab.com/BuildStream/buildstream-tests.git
- cd buildstream-tests
- ./run-test.sh --arg --colors --cov ../.coveragerc test
- cd integration-tests
- ./run-test.sh --arg --colors --cov ../.coveragerc --sources ${XDG_CACHE_HOME}/buildstream/sources test
- cd ..
- mkdir -p coverage-linux/
- cp buildstream-tests/.coverage coverage-linux/coverage.linux
- cp -a cache/buildstream/logs logs-linux
- cp integration-tests/.coverage coverage-linux/coverage.linux
- cp -a integration-tests/tmp/logs logs-linux
artifacts:
paths:
......@@ -73,13 +72,12 @@ integration_unix:
BST_FORCE_BACKEND: "unix"
script:
- pip3 install .
- git clone https://gitlab.com/BuildStream/buildstream-tests.git
- cd buildstream-tests
- ./run-test.sh --arg --colors --cov ../.coveragerc test
- cd integration-tests
- ./run-test.sh --arg --colors --cov ../.coveragerc --sources ${XDG_CACHE_HOME}/buildstream/sources test
- cd ..
- mkdir -p coverage-unix/
- cp buildstream-tests/.coverage coverage-unix/coverage.unix
- cp -a cache/buildstream/logs logs-unix
- cp integration-tests/.coverage coverage-unix/coverage.unix
- cp -a integration-tests/tmp/logs logs-unix
artifacts:
paths:
......
x86image-test/
git-test
ostree-test/
kind: script
description: Run autotools-built binary
depends:
- filename: dependencies/base-platform.bst
type: build
- filename: amhello.bst
type: build
config:
commands:
- "/usr/bin/hello > /buildstream/install/test"
kind: autotools
description: Autotools test
depends:
- filename: dependencies/base-platform.bst
type: build
- filename: dependencies/base-sdk.bst
type: build
sources:
- kind: tar
url: file:///amhello.tar.gz
ref: 3aa3c2bf7a488fea24303c4d98d1b5c0a72734f61615b935cf62e4e126b127d2
kind: import
description: Import the base freedesktop platform
config:
source: files
public:
bst:
integration-commands:
- ldconfig
arches:
x86_64:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BasePlatform/x86_64/1.4
gpg-key: keys/gnome-sdk.gpg
ref: c9d09b7250a12ef09d95952fc4f49a35e5f8c2c1dd7141b7eeada4069e6f6576
i386:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BasePlatform/i386/1.4
gpg-key: keys/gnome-sdk.gpg
ref: 27ebae91839a454596a273391b0e53063eaa8aca4fc9cb64654582bfbc338c96
kind: import
description: Import the base freedesktop SDK
config:
source: files
target: usr
arches:
x86_64:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BaseSdk/x86_64/1.4
gpg-key: keys/gnome-sdk.gpg
ref: 0d9d255d56b08aeaaffb1c820eef85266eb730cb5667e50681185ccf5cd7c882
i386:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BaseSdk/i386/1.4
gpg-key: keys/gnome-sdk.gpg
ref: 16036b747c1ec8e7fe291f5b1f667cb942f0267d08fcad962e9b7627d6cf1981
This is a demonstration package for GNU Automake.
Type `info Automake' to read the Automake manual.
# Import-test BuildStream project configuration.
# Project name
#
name: script-test
aliases:
gnomesdk: https://sdk.gnome.org/
# Base project relative element path, elements will be loaded
# from this base.
element-path: elements
#!/bin/bash
#
# A script to run a BuildStream test case.
TEST_DIR="elements/"
RESULTS="results/"
EXPECTED="expected/"
set -eu
# run_test
#
# Run tests for this test case.
#
# This should create a set of directories that match the directories
# in 'results/', as well as a log of the BuildStream output in
# 'test_log.log'.
#
run_test () {
local element
local elements
local element_name
local test_dir
local bst_file
local tar_file
local successes=0
local total=0
local exit
source ../lib.sh
tar_file="$(dirname "$(readlink -f "$0")")/src/amhello.tar.gz"
bst_file="$(dirname "$(readlink -f "$0")")/elements/amhello.bst"
patch_file_location "$bst_file" "$tar_file"
mkdir -p "$TEST_DIR"
elements="$(find "$TEST_DIR" -maxdepth 1 -type f)"
for element in $elements;
do
total=$((total + 1))
element_name="$(basename "$element")"
element_name="${element_name%.*}"
test_dir="$RESULTS/$element_name"
echo "Running test '$element_name'"
bst_with_flags build "$element_name".bst
bst_with_flags checkout "$element_name".bst "$test_dir"
exit=0
compare_results "$element_name" "$RESULTS" "$EXPECTED" || exit=$?
if [ $exit == 0 ]
then
successes=$((successes + 1))
fi
done
if [ $total != $successes ]
then
return 1
fi
}
run_test "$@"
kind: manual
description: bzr test
depends:
- filename: dependencies/base-platform.bst
type: build
- filename: dependencies/base-sdk.bst
type: build
sources:
- kind: bzr
url: file:///src
track: trunk
ref: '2'
config:
install-commands:
- "mkdir -p %{install-root}"
- "./test"
kind: import
description: Import the base freedesktop platform
config:
source: files
public:
bst:
integration-commands:
- ldconfig
arches:
x86_64:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BasePlatform/x86_64/1.4
gpg-key: keys/gnome-sdk.gpg
ref: c9d09b7250a12ef09d95952fc4f49a35e5f8c2c1dd7141b7eeada4069e6f6576
i386:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BasePlatform/i386/1.4
gpg-key: keys/gnome-sdk.gpg
ref: 27ebae91839a454596a273391b0e53063eaa8aca4fc9cb64654582bfbc338c96
kind: import
description: Import the base freedesktop SDK
config:
source: files
target: usr
arches:
x86_64:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BaseSdk/x86_64/1.4
gpg-key: keys/gnome-sdk.gpg
ref: 0d9d255d56b08aeaaffb1c820eef85266eb730cb5667e50681185ccf5cd7c882
i386:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BaseSdk/i386/1.4
gpg-key: keys/gnome-sdk.gpg
ref: 16036b747c1ec8e7fe291f5b1f667cb942f0267d08fcad962e9b7627d6cf1981
# Import-test BuildStream project configuration.
# Project name
#
name: script-test
aliases:
gnomesdk: https://sdk.gnome.org/
# Base project relative element path, elements will be loaded
# from this base.
element-path: elements
#!/bin/bash
#
# A script to run a BuildStream test case.
TEST_DIR="elements/"
RESULTS="results/"
EXPECTED="expected/"
set -eu
# run_test
#
# Run tests for this test case.
#
# This should create a set of directories that match the directories
# in 'results/', as well as a log of the BuildStream output in
# 'test_log.log'.
#
run_test () {
local element
local elements
local element_name
local test_dir
local bst_file
local tar_file
local successes=0
local total=0
local exit
source ../lib.sh
tar_file="$(dirname "$(readlink -f "$0")")/src"
bst_file="$(dirname "$(readlink -f "$0")")/elements/bzr-test.bst"
patch_file_location "$bst_file" "$tar_file"
mkdir -p "$TEST_DIR"
elements="$(find "$TEST_DIR" -maxdepth 1 -type f)"
for element in $elements;
do
total=$((total + 1))
element_name="$(basename "$element")"
element_name="${element_name%.*}"
test_dir="$RESULTS/$element_name"
echo "Running test '$element_name'"
bst_with_flags build "$element_name".bst
bst_with_flags checkout "$element_name".bst "$test_dir"
exit=0
compare_results "$element_name" "$RESULTS" "$EXPECTED" || exit=$?
if [ $exit == 0 ]
then
successes=$((successes + 1))
fi
done
if [ $total != $successes ]
then
return 1
fi
}
run_test "$@"
This is a Bazaar control directory.
Do not change any files in this directory.
See http://bazaar.canonical.com/ for more information about Bazaar.
Bazaar-NG meta directory, format 1
Bazaar repository format 2a (needs bzr 1.16 or later)
B+Tree Graph Index 2
node_ref_lists=0
key_elements=1
len=0
row_lengths=
B+Tree Graph Index 2
node_ref_lists=0
key_elements=1
len=2
row_lengths=1
x%˱ 1 7EF0
$h$^ޟ?uML[GxWzPXu"J&w;– (<#%Y
Uf||"#
\ No newline at end of file
B+Tree Graph Index 2
node_ref_lists=0
key_elements=1
len=0
row_lengths=
This is a Bazaar control directory.
Do not change any files in this directory.
See http://bazaar.canonical.com/ for more information about Bazaar.
Bazaar Branch Format 7 (needs bzr 1.6)
2 tristan.maat@codethink.co.uk-20170629145450-002fmq5jowd85hfz
#!/usr/bin/env bash
echo "test" > /buildstream/install/test
kind: import
description: Import the base freedesktop platform
config:
source: files
public:
bst:
integration-commands:
- ldconfig
arches:
x86_64:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BasePlatform/x86_64/1.4
gpg-key: keys/gnome-sdk.gpg
ref: c9d09b7250a12ef09d95952fc4f49a35e5f8c2c1dd7141b7eeada4069e6f6576
i386:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BasePlatform/i386/1.4
gpg-key: keys/gnome-sdk.gpg
ref: 27ebae91839a454596a273391b0e53063eaa8aca4fc9cb64654582bfbc338c96
kind: import
description: Import the base freedesktop SDK
config:
source: files
target: usr
arches:
x86_64:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BaseSdk/x86_64/1.4
gpg-key: keys/gnome-sdk.gpg
ref: 0d9d255d56b08aeaaffb1c820eef85266eb730cb5667e50681185ccf5cd7c882
i386:
sources:
- kind: ostree
url: gnomesdk:repo/
track: runtime/org.freedesktop.BaseSdk/i386/1.4
gpg-key: keys/gnome-sdk.gpg
ref: 16036b747c1ec8e7fe291f5b1f667cb942f0267d08fcad962e9b7627d6cf1981
kind: script
description: Cmake binary run test
depends:
- filename: dependencies/base-platform.bst
type: build
- filename: step7.bst
type: build
config:
commands:
- "/usr/bin/Tutorial 9 > /buildstream/install/test"
kind: cmake
description: Cmake test
depends:
- filename: dependencies/base-platform.bst
type: build
- filename: dependencies/base-sdk.bst
type: build
sources:
- kind: tar
url: file:///home/tristanmaat/Documents/Projects/buildstream/buildstream-tests/cmake-test/src/step7.tar.gz
ref: 9591707afbae77751730b4af4c52a18b1cdc4378237bc64055f099bc95c330db
Computing sqrt of 9 to be 3
Computing sqrt of 9 to be 3
Computing sqrt of 9 to be 3
Computing sqrt of 9 to be 3
Computing sqrt of 9 to be 3
Computing sqrt of 9 to be 3
Computing sqrt of 9 to be 3
Computing sqrt of 9 to be 3
Computing sqrt of 9 to be 3
Computing sqrt of 9 to be 3
The square root of 9 is 3
// the configured options and settings for Tutorial
#define Tutorial_VERSION_MAJOR 1
#define Tutorial_VERSION_MINOR 0
#define USE_MYMATH
// does the platform provide exp and log functions?
/* #undef HAVE_LOG */
/* #undef HAVE_EXP */
# Import-test BuildStream project configuration.
# Project name
#
name: script-test
aliases:
gnomesdk: https://sdk.gnome.org/
# Base project relative element path, elements will be loaded
# from this base.
element-path: elements
#!/bin/bash
#
# A script to run a BuildStream test case.
TEST_DIR="elements/"
RESULTS="results/"
EXPECTED="expected/"
set -eu
# run_test
#
# Run tests for this test case.
#
# This test has more manual intervention since it creates binary files
# which may change.
#
run_test () {
local bst_file
local tar_file
local successes=0
local total=2
local exit
source ../lib.sh
###############################################################
### Setup
###############################################################
tar_file="$(dirname "$(readlink -f "$0")")/src/step7.tar.gz"