Commit c582821c authored by Paal Kvamme's avatar Paal Kvamme
Browse files

Merge branch 'kvamme62/sync-devops' into 'master'

Sync with in-house changes

See merge request !86
parents 80f8e67c d6bf6fbf
Pipeline #55463 passed with stages
in 18 minutes and 41 seconds
......@@ -31,6 +31,23 @@ MY_OVERRIDES += $(if $(SDAPI_INTERNAL),SD_ZIPFILE=$(BUILDROOT)/seismic-service-b
.PHONY: python native wrapper build clean clobber docker-build docker-buildtest docker-test docker noop doxygen
# This Makefile does not support parallel execution with -j N.
#
# Make would conclude that it may choose to build native, sdglue,
# wrapper, and python in parallel. But the "wrapper" target will build
# (but not test) the "native" library using a recursive make. While
# the "native" target does a similar recursive build, with tests.
# There are probably others. It is possible to restructure the rules
# so Make knows about those dependencies. But that is hardly useful
# because most rules in this file would end up being serialized
# anyway.
#
# The next declaration causes any "-j N" option to be ingored in this
# Makefile but it will still be honored by recursive makes. Unless
# those sub-makefiles choose to do the same.
.NOTPARALLEL:
all: native sdglue wrapper python
noop:
......
......@@ -144,6 +144,13 @@ jobs:
publishVstsFeed: 'ad4cb17d-525f-488d-93b3-3903b262a93b'
displayName: 'Publish nuget package'
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Build.SourcesDirectory)/*.nupkg;'
nuGetFeedType: 'external'
publishFeedCredentials: 'PetrelLibraries'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
......
......@@ -120,3 +120,13 @@ steps:
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: OpenZGY-${{parameters.linuxdistro}}
- task: UniversalPackages@0
inputs:
command: 'publish'
publishDirectory: $(Build.ArtifactStagingDirectory)
feedsToUsePublish: 'internal'
vstsFeedPublish: 'openzgy'
vstsFeedPackagePublish: openzgy-${{parameters.linuxdistro}}
versionOption: 'patch'
packagePublishDescription: 'OpenZGY build for ${{parameters.linuxdistro}}'
......@@ -28,6 +28,7 @@ steps:
- bash: |
echo 'parameters.havesd: ${{parameters.havesd}}'
eval $(test ! -x openzgy/private/grabtoken.sh || bash openzgy/private/grabtoken.sh -vv)
ls -la '$(Build.SourcesDirectory)\openzgy\build\deploy\native\${{parameters.platform}}\${{parameters.configuration}}'
'$(Build.SourcesDirectory)\openzgy\build\deploy\native\${{parameters.platform}}\${{parameters.configuration}}\OpenZGY.Test.exe'
env:
OPENZGY_SDURL: $(SEISMIC_STORE_URL)
......
......@@ -18,6 +18,12 @@
SELF := $(lastword $(MAKEFILE_LIST))
include ../../scripts/Make.defs
# This Makefile does not support parallel execution with -j N.
# There is practically nothing at this level that can be done
# in parallel. For that reason, no effort has been make to ensure
# that the rules are correct as far as parallelization goes.
.NOTPARALLEL:
.PHONY: all
all: build test
......
......@@ -17,6 +17,15 @@
# PLATFORM CONFIG (consumed) MYPLATFORM MYCONFIG (produced)
include ../../scripts/Make.defs
# Uncomment to disable parallel execution with -j N.
# The dependencies might not be 100% correct. My excuse for not fixing
# this properly is that the test target, which just runs a single
# executable, takes much longer than the compliation anyway. The
# automated build pipeline should not use -j. Developers building
# locally can do so at their own risk. Your mileage may vary regarding
# whether the -j option really does speed things up.
#.NOTPARALLEL:
.PHONY: all all-no-doxygen
all: build doxygen doxyint test
all-no-doxygen: build test
......@@ -236,6 +245,7 @@ clobber: clean
# The automatic dependency generator doesn't catch SDAPI / ZFP header files.
$(OBJ_DIR)/impl/file_sd.o: $(SD_SENTINEL)
$(OBJ_DIR)/test/test_file.o: $(SD_SENTINEL)
$(OBJ_DIR)/test/test_sdutils.o: $(SD_SENTINEL)
$(OBJ_DIR)/impl/compress_zfp.o: $(ZFP_SENTINEL)
# Note: If gcc finds that foo.o depends on inc.h, I will make foo.o, */foo.o
......
......@@ -152,7 +152,7 @@ int test_check__(int cond, const char* file, int line, const char* fmt, ...);
static char* test_argv0__ = NULL;
static int test_count__ = 0;
static int test_no_exec__ = 0;
static int test_no_exec__ = 1;
static int test_no_summary__ = 0;
static int test_skip_mode__ = 0;
......@@ -520,6 +520,7 @@ test_help__(void)
printf("Options:\n");
printf(" -s, --skip Execute all unit tests but the listed ones\n");
printf(" --no-exec Do not execute unit tests as child processes\n");
printf(" --exec Execute unit tests as child processes\n");
printf(" --no-summary Suppress printing of test results summary\n");
printf(" -l, --list List unit tests in the suite and exit\n");
printf(" -v, --verbose Enable more verbose output\n");
......@@ -585,6 +586,8 @@ main(int argc, char** argv)
test_skip_mode__ = 1;
} else if(strcmp(argv[i], "--no-exec") == 0) {
test_no_exec__ = 1;
} else if(strcmp(argv[i], "--exec") == 0) {
test_no_exec__ = 0;
} else if(strcmp(argv[i], "--no-summary") == 0) {
test_no_summary__ = 1;
} else if(strcmp(argv[i], "--list") == 0 || strcmp(argv[i], "-l") == 0) {
......
......@@ -14,6 +14,7 @@
#define CUTEST_HAS_MAIN
#include "test_all.h"
#include "../impl/environment.h"
#include <iostream>
#include <functional>
......@@ -21,6 +22,12 @@
#include <signal.h>
#endif
static bool enable_sd_tests()
{
static bool enabled = InternalZGY::Environment::getStringEnv("OPENZGY_TOKEN") != "";
return enabled;
}
static void do_nothing()
{
}
......@@ -46,6 +53,22 @@ void register_test(const char* name, void (*func)(void))
test_list__[pos].func = func;
}
void register_sd_test(const char* name, void (*func)(void))
{
if (enable_sd_tests())
register_test(name, func);
else {
char *noname = new char[strlen(name)+2];
noname[0] = '~';
// Re-implementing strcpy() because, Windows.
char *cp = &noname[1];
while(*name)
*cp++ = *name++;
*cp++ = '\0';
register_test(noname, do_nothing);
}
}
static int _global_verbose = 0;
/**
......
......@@ -21,4 +21,5 @@
#define NOMINMAX // cutest includes Windows.h. Ugh!
#include "cutest.h"
extern void register_test(const char* name, void (*func)(void));
extern void register_sd_test(const char* name, void (*func)(void));
extern int verbose();
......@@ -2821,9 +2821,10 @@ public:
register_test("api.compress_zfp", test_compress_zfp);
register_test("api.compress_off", test_compress_off);
#ifdef HAVE_SD
register_test("api.write_cloud", test_write_cloud);
register_test("api.write_cloud_mt", test_write_cloud_mt);
register_test("api.alturl", test_alturl);
register_sd_test("api.write_cloud", test_write_cloud);
register_sd_test("api.write_cloud_mt", test_write_cloud_mt);
// FAILS: Need to make the dataset read-only.
//register_sd_test("api.alturl", test_alturl);
#endif
register_test("api.historange", test_historange);
register_test("api.lod_lowpass", test_lod_lowpass);
......@@ -2844,14 +2845,14 @@ public:
register_test("api.2d", test_2d);
register_test("api.decimate_edge", test_decimate_edge);
#ifdef HAVE_SD
register_test("api.tokencb_destroy", test_tokencb_destroy);
register_test("api.tokencb_normal", test_tokencb_normal);
register_sd_test("api.tokencb_destroy", test_tokencb_destroy);
register_sd_test("api.tokencb_normal", test_tokencb_normal);
#endif
register_test("api.readwrite", test_readwrite_local);
#ifdef HAVE_SD
register_test("api.readwrite_cloud", test_readwrite_cloud);
register_test("api.hammer", test_hammer);
register_test("api.sderrors", test_sderrors);
register_sd_test("api.readwrite_cloud", test_readwrite_cloud);
register_sd_test("api.hammer", test_hammer);
register_sd_test("api.sderrors", test_sderrors);
#endif
register_test("api.edgebricks", test_edgebricks);
register_test("api.bat_local_1", test_bat_local_1);
......@@ -2859,10 +2860,10 @@ public:
register_test("api.bat_local_4", test_bat_local_4);
register_test("api.bat_local_zfp", test_bat_local_zfp);
#ifdef HAVE_SD
register_test("api.bat_sd_1", test_bat_sd_1);
register_test("api.bat_sd_2", test_bat_sd_2);
register_test("api.bat_sd_4", test_bat_sd_4);
register_test("api.bat_sd_zfp", test_bat_sd_zfp);
register_sd_test("api.bat_sd_1", test_bat_sd_1);
register_sd_test("api.bat_sd_2", test_bat_sd_2);
register_sd_test("api.bat_sd_4", test_bat_sd_4);
register_sd_test("api.bat_sd_zfp", test_bat_sd_zfp);
#endif
}
} dummy;
......
......@@ -367,10 +367,10 @@ namespace {
{
register_test("file.localfilefactory", test_localfilefactory);
#ifdef HAVE_SD
register_test("aaa.sdtoken", test_sdtoken);
register_test("file.sdfilefactory", test_sdfilefactory);
register_test("file.sdfiledelete", test_sdfiledelete);
register_test("file.sdreopen", test_sdreopen);
register_sd_test("aaa.sdtoken", test_sdtoken);
register_sd_test("file.sdfilefactory", test_sdfilefactory);
register_sd_test("file.sdfiledelete", test_sdfiledelete);
register_sd_test("file.sdreopen", test_sdreopen);
#endif
}
} dummy;
......
......@@ -2454,9 +2454,9 @@ public:
register_test("reopen.zgypublic", test_reopen_zgypublic);
register_test("reopen.track_changes", test_reopen_track_changes);
#ifdef HAVE_SD
register_test("reopen.plain_sd", test_reopen_plain_sd);
register_test("reopen.sd", test_reopen_sd);
register_test("reopen.zgycloud", test_reopen_zgycloud);
register_sd_test("reopen.plain_sd", test_reopen_plain_sd);
register_sd_test("reopen.sd", test_reopen_sd);
register_sd_test("reopen.zgycloud", test_reopen_zgycloud);
#endif
}
} dummy_reopen;
......
......@@ -165,9 +165,9 @@ namespace {
{
using Test::TestSmallCache;
#ifdef HAVE_SD
register_test("smallcache.regular", TestSmallCache::test_regular);
register_test("smallcache.fewbricks", TestSmallCache::test_fewbricks);
register_test("smallcache.manybricks", TestSmallCache::test_manybricks);
register_sd_test("smallcache.regular", TestSmallCache::test_regular);
register_sd_test("smallcache.fewbricks", TestSmallCache::test_fewbricks);
register_sd_test("smallcache.manybricks", TestSmallCache::test_manybricks);
#endif
}
} dummy;
......
......@@ -39,6 +39,14 @@ DOX_TMP = $(BUILDROOT)/build/temp/pure/doxygen
.PHONY: all all-no-doxygen build venv vtest coverage vcoverage init data clean clobber install vinstall deploy push help-push
# This Makefile does not support parallel execution with -j N.
# There is not much at this level that can be done in parallel.
# For that reason, no effort has been make to ensure that the
# rules are correct as far as parallelization goes.
# A future enhancement would be to restructure the "test" rule
# so the tests, if nothing else, might be run in parallel.
.NOTPARALLEL:
# Note that I might not need to build and install in order to test.
# Just invoke the vtest target only.
......
......@@ -45,7 +45,7 @@ ${PIP} install -r ../../build/deploy/pure/requirements.txt
${PIP} install ../../external/ZgyBindings*.whl || true
${PIP} install ../../external/ZgyCompressor*.whl || true
${PIP} install ../../build/deploy/pure/OpenZGY-*.whl
if [ -r ../../build/deploy/sdglue/${MYPLATFORM}/SdGlue-*.whl ]
if [ -r ../../build/deploy/sdglue/${MYPLATFORM}/SdGlue-*.whl -a "x${OPENZGY_TOKEN}" != "x" ]
then
${PIP} install ../../build/deploy/sdglue/${MYPLATFORM}/SdGlue-*.whl
echo "Testing OpenZGY/Python with cloud access for ${MYPLATFORM}"
......
......@@ -26,7 +26,7 @@ RUN python3 -m pip install build/deploy/wrapper/*/OpenZgyBindings-*.whl
# Optional: Prepare for running unit tests
RUN tar xvf build/deploy/testscripts.tar; \
python3 -m pip install virtualenv; \
apt-get -y install bzip2 curl
apt-get update; apt-get -y install bzip2 curl
# Optional: Run as a regular user
RUN useradd -u 800 -g users build; \
......
......@@ -26,7 +26,7 @@ RUN python3 -m pip install build/deploy/wrapper/*/OpenZgyBindings-*.whl
# Optional: Prepare for running unit tests
RUN tar xvf build/deploy/testscripts.tar; \
python3 -m pip install virtualenv; \
apt-get -y install bzip2 curl
apt-get update; apt-get -y install bzip2 curl
# Optional: Run as a regular user
RUN useradd -u 800 -g users build; \
......
......@@ -26,7 +26,7 @@ RUN python3 -m pip install build/deploy/wrapper/*/OpenZgyBindings-*.whl
# Optional: Prepare for running unit tests
RUN tar xvf build/deploy/testscripts.tar; \
python3 -m pip install virtualenv; \
apt-get -y install bzip2 curl
apt-get update && apt-get -y install bzip2 curl
# Optional: Run as a regular user
RUN useradd -u 800 -g users build; \
......
......@@ -25,9 +25,9 @@ nuget {
[x64,release,dynamic] {
bin += ${x64_release}\OpenZGY.dll;
bin += ${x64_release}\zfp.dll;
bin += ${x64_debug}\OpenZGY.Tools.BulkInspector.exe;
bin += ${x64_debug}\OpenZGY.Tools.MetaInspector.exe;
bin += ${x64_debug}\OpenZGY.Tools.ZgyCopy.exe;
bin += ${x64_release}\OpenZGY.Tools.BulkInspector.exe;
bin += ${x64_release}\OpenZGY.Tools.MetaInspector.exe;
bin += ${x64_release}\OpenZGY.Tools.ZgyCopy.exe;
lib += {
${x64_release}\OpenZGY.lib;
......
......@@ -21,6 +21,11 @@ RUNARGS += -v $(WORKAREA):/home/me/sdapi:ro
#RUNARGS += -v $(WORKAREA2):/home/me/seismic-store-sdutil:ro
RUNARGS += -v $(CWD)/build.sh:/home/me/build.sh
# This Makefile does not support parallel execution with -j N
# The only really time consuming part is to build the Azure
# prerequisites, and the task for that will enable parallel itself.
.NOTPARALLEL:
all:
@echo "Remember to update the paths at the top of this Makefile."
@echo
......@@ -147,3 +152,11 @@ clean:
clobber: clean
docker rm --force $(patsubst %,sd-%,$(DISTROS)) || true
# Note: As of 30-Jun-2021 this kludge is needed...
.PHONY: fix-cmake
fix-cmake:
docker cp sd-omega:/opt/vcpkg/scripts/buildsystems/vcpkg.cmake vcpkg.cmake
docker cp vcpkg.cmake sd-bionic:/opt/vcpkg/scripts/buildsystems/vcpkg.cmake
docker cp vcpkg.cmake sd-buster:/opt/vcpkg/scripts/buildsystems/vcpkg.cmake
$(RM) vcpkg.cmake
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment