From 06054fc4abf895d8c934e56f586c293f57f09bf4 Mon Sep 17 00:00:00 2001 From: Valentin Reis Date: Wed, 9 Jan 2019 16:28:50 -0600 Subject: [PATCH] [fix] progress and phase context message format fix removing extra quotes, adding 'api' field, 'event' -> 'type' --- .gitlab-ci.yml | 66 ++---------------------------------------------- .nix/default.nix | 2 +- src/nrm.h | 4 +-- 3 files changed, 5 insertions(+), 67 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 65bdd5d..757b8f2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,5 @@ +include: 'https://xgitlab.cels.anl.gov/argo/argotest/raw/master/gitlab/basic.yml' + stages: - build - test @@ -17,67 +19,3 @@ stages: #- /^wip.*/ #- /^WIP.*/ # - -.nix-build: - stage: build - tags: - - integration - -.nix-integration: - stage: test - artifacts: - paths: - - _output/cmd_err.log - - _output/cmd_out.log - - _output/daemon_out.log - - _output/daemon_out.log - - _output/nrm.log - - _output/.argo_nodeos_config_exit_message - expire_in: 1 week - except: - - /^wip\/.*/ - - /^WIP\/.*/ - tags: - - integration - -containers.build: - extends: .nix-build - script: - - CACHE=$(mktemp -d --suffix=nixcache /tmp/deletable-nix-cache-XXXX) - - XDG_CACHE_HOME=$CACHE nix-build .nix -A containers - - rm -rf $CACHE - -libnrm.build: - extends: .nix-build - script: - - CACHE=$(mktemp -d --suffix=nixcache /tmp/deletable-nix-cache-XXXX) - - XDG_CACHE_HOME=$CACHE nix-build .nix -A libnrm - - rm -rf $CACHE - -nrm.build: - extends: .nix-build - script: - - CACHE=$(mktemp -d --suffix=nixcache /tmp/deletable-nix-cache-XXXX) - - XDG_CACHE_HOME=$CACHE nix-build .nix -A nrm - - rm -rf $CACHE - -TestHello.test: - extends: .nix-integration - script: - - CACHE=$(mktemp -d --suffix=nixcache /tmp/deletable-nix-cache-XXXX) - - XDG_CACHE_HOME=$CACHE nix-shell .nix -A test --run "argotk.hs TestHello" - - rm -rf $CACHE - -TestListen.test: - extends: .nix-integration - script: - - CACHE=$(mktemp -d --suffix=nixcache /tmp/deletable-nix-cache-XXXX) - - XDG_CACHE_HOME=$CACHE nix-shell .nix -A test --run "argotk.hs TestListen" - - rm -rf $CACHE - -TestPerfwrapper.test: - extends: .nix-integration - script: - - CACHE=$(mktemp -d --suffix=nixcache /tmp/deletable-nix-cache-XXXX) - - XDG_CACHE_HOME=$CACHE nix-shell .nix -A test --run "argotk.hs TestPerfwrapper" - - rm -rf $CACHE diff --git a/.nix/default.nix b/.nix/default.nix index 0f0c8c9..653eb06 100644 --- a/.nix/default.nix +++ b/.nix/default.nix @@ -3,5 +3,5 @@ let argotest = "https://xgitlab.cels.anl.gov/argo/argotest/-/archive/master/argotest-master.tar.gz"; in import "${argotest}/test.nix" { libnrm-override = ./..; - testName = "base"; + testName = "refactored"; } diff --git a/src/nrm.h b/src/nrm.h index 35fcdad..170a3f6 100644 --- a/src/nrm.h +++ b/src/nrm.h @@ -32,8 +32,8 @@ struct nrm_context { #define NRM_ENV_URI "ARGO_NRM_DOWNSTREAM_EVENT_URI" #define NRM_START_FORMAT "{\"api\":\"down_event\", \"type\":\"application_start\", \"container_uuid\": \"%s\", \"application_uuid\": \"%s\"}" -#define NRM_PROGRESS_FORMAT "{\"api\":\"down_event\", \"type\":\"progress\", \"payload\": \"%lu\"}" -#define NRM_PHASE_CONTEXT_FORMAT "{\"type\":\"application\", \"event\":\"phase_context\", \"cpu\": \"%u\", \"aggregation\": \"%u\", \"computetime\": \"%llu\", \"totaltime\": \"%llu\", \"uuid\": \"%s\"}" +#define NRM_PROGRESS_FORMAT "{\"api\":\"down_event\", \"type\":\"progress\", \"payload\": %lu}" +#define NRM_PHASE_CONTEXT_FORMAT "{\"api\":\"down_event\",\"type\":\"phase_context\", \"cpu\": %u, \"aggregation\": %u, \"computetime\": %llu, \"totaltime\": %llu, \"application_uuid\": \"%s\"}" #define NRM_EXIT_FORMAT "{\"api\": \"down_event\", \"type\":\"application_exit\"}" int nrm_init(struct nrm_context *, const char *); -- 2.26.2