Skip to content
Snippets Groups Projects
Commit 6fbbf338 authored by Jonas Höppner's avatar Jonas Höppner
Browse files

CI: Add fake lava test to ci-test, reduce fetch depth in update submodule

parent d820110c
No related branches found
No related tags found
No related merge requests found
...@@ -192,7 +192,7 @@ build:merge_request: ...@@ -192,7 +192,7 @@ build:merge_request:
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
# Stage: test # Stage: test
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
.test: .test-simple:
stage: test stage: test
rules: rules:
- if: $CI_COMMIT_REF_NAME != $MASTER_BRANCH_MANIFEST || $CI_PIPELINE_SOURCE == "api" - if: $CI_COMMIT_REF_NAME != $MASTER_BRANCH_MANIFEST || $CI_PIPELINE_SOURCE == "api"
...@@ -206,12 +206,85 @@ build:merge_request: ...@@ -206,12 +206,85 @@ build:merge_request:
test:pass: test:pass:
extends: extends:
- .test - .test-simple
variables: variables:
RETURNCODE: 0 RETURNCODE: 0
test:fail: test:fail:
extends: extends:
- .test - .test-simple
variables: variables:
RETURNCODE: 1 RETURNCODE: 1
# ---------------------------------------------------------------------------------------
# Stage: test
# ---------------------------------------------------------------------------------------
.test:
extends:
- .infrastructure
timeout: 1h
rules:
- if: $CI_COMMIT_REF_NAME != $MASTER_BRANCH_MANIFEST || $CI_PIPELINE_SOURCE == "api"
when: manual
allow_failure: true
variables:
# Include git submodules
GIT_SUBMODULE_STRATEGY: recursive
CI_PARAM_TEST_SUITE: '{platform}.jinja2'
CI_PARAM_EXTRA: --nop
LOGPREFIX: "CI:test:"
artifacts:
when: always
paths:
- "results/**"
reports:
junit: results/results-*.xml
before_script:
# Setup ssh key to access private repos
# https://docs.gitlab.com/ee/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor
# An SSH keypair has been generated for the manifest's pipeline to be able to access
# all private repositories in the manifest. The private key has been stored in the
# CI/CD variable GITLAB_PRIVATE_KEY of the manifest repository. The public key has
# been added as a deploy key in GitLab's repository settings for all contained
# repositories.
- echo "${LOGPREFIX} Setup SSH"
- eval $(ssh-agent -s)
- echo "$GITLAB_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
# Add GitLab server to known hosts
# https://docs.gitlab.com/ee/ci/ssh_keys/#verifying-the-ssh-host-keys
# In order to access the private repositories via SSH, the GitLab server has to be
# added to the known_hosts file. The host keys were determined using the command
# ssh-keyscan [-p port] <gitlab-server>
# and have been stored in the GITLAB_KNOWN_HOSTS CI/CD variable.
- echo "$GITLAB_KNOWN_HOSTS" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- |-
# Submit tests to lava server
# Use existing release as we don't build in CI-test
DEPLOYPATH_TEST="http://srv73/SoftwareStore/Linux-Yocto/Releases/"
RELEASE="Yocto-dunfell-15.0/"
INSTALLSCRIPT_ABS="$DEPLOYPATH_TEST/$RELEASE/$CI_PARAM_MACHINE/fng-install.sh"
FNG_INSTALL_URL="${INSTALLSCRIPT_ABS#/*/}"
.gitlab-ci/submit_test.py \
--fng-install "${FNG_INSTALL_URL}" \
--name \
"Gitlab build test ${CI_PARAM_MACHINE} ${RELEASE} ${CI_PIPELINE_ID}" \
--results-path "results" \
--test-repo ${TESTS_GIT_URL} \
--test-repo-branch dunfell \
--test-plan ${CI_PARAM_TEST_SUITE} \
${CI_PARAM_EXTRA} \
${CI_PARAM_PLATFORMS}
smoketest:imx6guf:
extends: .test
stage: test
variables:
CI_PARAM_MACHINE: imx6guf
CI_PARAM_PLATFORMS: imx6guf
CI_PARAM_TEST_SUITE: boot.jinja2
CI_PARAM_EXTRA: --all-devices
...@@ -22,6 +22,11 @@ variables: ...@@ -22,6 +22,11 @@ variables:
MASTER_BRANCH_MANIFEST: dunfell MASTER_BRANCH_MANIFEST: dunfell
MASTER_BRANCH_PROJECT: dunfell MASTER_BRANCH_PROJECT: dunfell
DEPLOYPATH_TEST: "/artifacts/${CI_JOB_ID}/"
GITLAB_SERVER: "${CI_SERVER_HOST}:${CI_SERVER_SSH_PORT}"
GIT_BASE_URL: "ssh://git@${GITLAB_SERVER}/${CI_PROJECT_ROOT_NAMESPACE}"
TESTS_GIT_URL: "${GIT_BASE_URL}/yocto/tests.git"
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
# Common infrastructure settings # Common infrastructure settings
......
...@@ -174,7 +174,11 @@ def main(): ...@@ -174,7 +174,11 @@ def main():
args, _ = parser.parse_known_args() args, _ = parser.parse_known_args()
if args.verbose: if args.verbose:
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s %(levelname)-8s %(message)s",
datefmt="%H:%M:%S",
)
gitlab = Gitlab(args.gitlab_url, private_token=args.token) gitlab = Gitlab(args.gitlab_url, private_token=args.token)
......
...@@ -5,10 +5,6 @@ variables: ...@@ -5,10 +5,6 @@ variables:
IMAGEPATH: "${IMAGEBASEPATH}/${CI_PARAM_MACHINE}" IMAGEPATH: "${IMAGEBASEPATH}/${CI_PARAM_MACHINE}"
LICENSESPATH: "tmp/deploy/licenses" LICENSESPATH: "tmp/deploy/licenses"
SDKPATH: "tmp/deploy/sdk/" SDKPATH: "tmp/deploy/sdk/"
DEPLOYPATH_TEST: "/artifacts/${CI_JOB_ID}/"
GITLAB_SERVER: "${CI_SERVER_HOST}:${CI_SERVER_SSH_PORT}"
GIT_BASE_URL: "ssh://git@${GITLAB_SERVER}/${CI_PROJECT_ROOT_NAMESPACE}"
TESTS_GIT_URL: "${GIT_BASE_URL}/yocto/tests.git"
.docker_check: &docker_check .docker_check: &docker_check
# Check if the build folder is empty. Sometimes the docker volume for the build is not # Check if the build folder is empty. Sometimes the docker volume for the build is not
......
...@@ -373,7 +373,7 @@ def update_submodule_and_include_ref( ...@@ -373,7 +373,7 @@ def update_submodule_and_include_ref(
# ======================================================== # ========================================================
# Squash all commits on the integration branch to one # Squash all commits on the integration branch to one
# ======================================================== # ========================================================
project_repo.remotes.origin.fetch(branch) project_repo.remotes.origin.fetch(branch, depth=5)
gitlab_branch = project.branches.get(branch) gitlab_branch = project.branches.get(branch)
project_repo.git.reset("--soft", gitlab_branch.commit["id"]) project_repo.git.reset("--soft", gitlab_branch.commit["id"])
...@@ -441,7 +441,11 @@ def main(): ...@@ -441,7 +441,11 @@ def main():
args, _ = parser.parse_known_args() args, _ = parser.parse_known_args()
if args.verbose: if args.verbose:
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s %(levelname)-8s %(message)s",
datefmt="%H:%M:%S",
)
gitlab = Gitlab(args.gitlab_url, private_token=args.token) gitlab = Gitlab(args.gitlab_url, private_token=args.token)
project = common.get_project(gitlab, args.project) project = common.get_project(gitlab, args.project)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment