From 89ed91dfeece72af1d7720d35180cc42c6a2173f Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Wed, 8 Sep 2021 10:42:06 +0200
Subject: [PATCH] Add GC.gc call to a retrieval test and update the pipeline

---
 .gitlab-ci.yml   | 6 ++++--
 test/runtests.jl | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c8f19c4..e1a8562 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -43,7 +43,7 @@ variables:
   # The defalt branch to use with caosdb-cpplib
   # TODO: Change back to dev once f-consolidate-c has been merged
   CPP_DEFAULT_BRANCH: dev
-  
+
 stages:
   - info
   - code-style
@@ -65,6 +65,7 @@ info:
     - echo "CAOSDB_TAG = $CAOSDB_TAG"
     - echo "REFTAG = $REFTAG"
     - echo "F_BRANCH = $F_BRANCH"
+    - echo "CPPLIB_REF = $CPPLIB_REF"
     - ls -lah /image-cache/
 
 code-style:
@@ -97,12 +98,13 @@ build-testenv: &build-testenv
   timeout: 2h
   needs: []
   script:
+    - CPPLIB_REF=${CPPLIB_REF:-${CPP_DEFAULT_BRANCH}}
     - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
     - docker pull $JULIALIB_REGISTRY_IMAGE || true
     - docker build
       --build-arg JULIALIB_REGISTRY_IMAGE=$JULIALIB_REGISTRY_IMAGE
       --build-arg F_BRANCH=$F_BRANCH
-      --build-arg CPP_DEFAULT_BRANCH=$CPP_DEFAULT_BRANCH
+      --build-arg CPP_DEFAULT_BRANCH=$CPPLIB_REF
       --file .docker/Dockerfile
       --pull
       --cache-from $JULIAINTTEST_REGISTRY_IMAGE
diff --git a/test/runtests.jl b/test/runtests.jl
index 49dadca..8dad4e8 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -126,6 +126,7 @@ end
 
         # Helper functions
         ent = retrieve("20")
+        GC.gc() # assure that ent still has a valid wrapped pointer
         @test get_name(ent) == "name"
 
         results = retrieve(["20", "21"])
-- 
GitLab