From f2fb5bdd2cc0bce7a9711ac772b76f5e899cd395 Mon Sep 17 00:00:00 2001 From: JP Swinski Date: Wed, 8 Nov 2023 20:05:06 +0000 Subject: [PATCH] fixed bug in pistache server; default to not running in cloud for test runner --- .github/workflows/memory_test.yml | 47 ---------------------------- packages/pistache/PistacheServer.cpp | 2 +- scripts/selftests/test_runner.lua | 31 +++++------------- targets/slideruleearth-aws/Makefile | 2 +- 4 files changed, 9 insertions(+), 73 deletions(-) delete mode 100644 .github/workflows/memory_test.yml diff --git a/.github/workflows/memory_test.yml b/.github/workflows/memory_test.yml deleted file mode 100644 index 6fb886b42..000000000 --- a/.github/workflows/memory_test.yml +++ /dev/null @@ -1,47 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: Memory Test - -on: - workflow_dispatch: - push: - branches: [ main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - schedule: - - cron: '0 23 * * 5' # Every Sunday at 11 pm - -jobs: - memtest_sliderule: - name: Sliderule memory test - runs-on: ubuntu-latest - container: ghcr.io/icesat2-sliderule/sliderule-buildenv:latest - - steps: - - name: Install dependencies - run: | - apt-get update -y - apt-get install -y curl valgrind - - - name: Checkout sliderule repository - uses: actions/checkout@v3 - - - name: Build sliderule - run: | - make config-development - make - make install - chmod +x scripts/systests/memtest.sh - - - name: Run Valgrind - run: ./scripts/systests/memtest.sh diff --git a/packages/pistache/PistacheServer.cpp b/packages/pistache/PistacheServer.cpp index 685132418..80ed97437 100644 --- a/packages/pistache/PistacheServer.cpp +++ b/packages/pistache/PistacheServer.cpp @@ -103,7 +103,7 @@ PistacheServer::verb_t PistacheServer::str2verb (const char* str) const char* PistacheServer::sanitize (const char* filename) { const char* safe_filename = StringLib::replace(filename, PATH_DELIMETER_STR, "_"); - FString safe_pathname(0, "%s%c%s%c%s.lua", CONFDIR, PATH_DELIMETER, "api", PATH_DELIMETER, safe_filename); + FString safe_pathname("%s%c%s%c%s.lua", CONFDIR, PATH_DELIMETER, "api", PATH_DELIMETER, safe_filename); delete [] safe_filename; return safe_pathname.c_str(true); } diff --git a/scripts/selftests/test_runner.lua b/scripts/selftests/test_runner.lua index 3e664df51..912e09d4d 100644 --- a/scripts/selftests/test_runner.lua +++ b/scripts/selftests/test_runner.lua @@ -1,17 +1,8 @@ local runner = require("test_executive") -local console = require("console") -local global = require("global") local td = runner.rootdir(arg[0]) -- root directory -local loglvl = global.eval(arg[1]) or core.INFO +local incloud = arg[1] == "cloud" --- Initial Configuration -- --- console.monitor:config(core.LOG, loglvl) --- sys.setlvl(core.LOG, loglvl) - -local maxRuns = 1 -for runNum = 1, maxRuns do - - -- Run Core Self Tests -- +-- Run Core Self Tests -- if __core__ then runner.script(td .. "tcp_socket.lua") runner.script(td .. "udp_socket.lua") @@ -63,7 +54,7 @@ if __legacy__ then end -- Run ICESat-2 Plugin Self Tests -if __icesat2__ then +if __icesat2__ and incloud then local icesat2_td = td .. "../../plugins/icesat2/selftests/" runner.script(icesat2_td .. "plugin_unittest.lua") runner.script(icesat2_td .. "atl03_reader.lua") @@ -75,13 +66,13 @@ if __icesat2__ then end -- Run opendata Plugin Self Tests -if __opendata__ then +if __opendata__ and incloud then local opendata_td = td .. "../../plugins/opendata/selftests/" runner.script(opendata_td .. "worldcover_reader.lua") end -- Run PGC Plugin Self Tests -if __pgc__ then +if __pgc__ and incloud then local pgc_td = td .. "../../plugins/pgc/selftests/" runner.script(pgc_td .. "arcticdem_reader.lua") runner.script(pgc_td .. "temporal_filter_test.lua") @@ -95,25 +86,17 @@ if __pgc__ then end -- Run Landsat Plugin Self Tests -if __landsat__ then +if __landsat__ and incloud then local landsat_td = td .. "../../plugins/landsat/selftests/" runner.script(landsat_td .. "landsat_reader.lua") end -- Run usgs3dep Plugin Self Tests -if __usgs3dep__ then +if __usgs3dep__ and incloud then local usg2dep_td = td .. "../../plugins/usgs3dep/selftests/" runner.script(usg2dep_td .. "usgs3dep_reader.lua") end - -if maxRuns > 1 then - print(string.format("\n--------------------------------\nTest Repeat Run: %d of %d finished\n--------------------------------", runNum, maxRuns)) - sys.wait(3) -end - -end -- test repeat loop end - -- Report Results -- local errors = runner.report() diff --git a/targets/slideruleearth-aws/Makefile b/targets/slideruleearth-aws/Makefile index 0539ae4bf..61cca7d28 100644 --- a/targets/slideruleearth-aws/Makefile +++ b/targets/slideruleearth-aws/Makefile @@ -68,7 +68,7 @@ MYIP ?= $(shell (ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$$/\1/p')) ENVVER = $(shell git --git-dir ../../.git --work-tree ../../.git describe --abbrev --dirty --always --tags --long) USERCFG ?= -TEST ?= $(ROOT)/scripts/selftests/test_runner.lua +TEST ?= $(ROOT)/scripts/selftests/test_runner.lua cloud MOSAICS_PERFORMANCE_TEST ?= $(ROOT)/plugins/pgc/systests/arcticdem_mosaic_perf.lua STRIPS_PERFORMANCE_TEST ?= $(ROOT)/plugins/pgc/systests/arcticdem_strips_perf.lua SUBSET_PERFORMANCE_TEST ?= $(ROOT)/scripts/systests/subset_perf_test.lua