From a1dd4321ba805a19fdd607802a2d81c76df30de5 Mon Sep 17 00:00:00 2001 From: codeworse Date: Sat, 14 Jun 2025 12:08:44 +0000 Subject: [PATCH 1/3] fix workflow --- .github/workflows/c-cpp.yml | 15 ++++----------- tests/data/setup.bash | 1 + tests/streaming.cpp | 3 +++ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 1a4481f..e4600d4 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -27,11 +27,6 @@ jobs: with: name: builds path: build* - - name: Upload test data - uses: actions/upload-artifact@v4 - with: - name: tests - path: tests/data/*.data test: runs-on: ubuntu-latest needs: build @@ -41,19 +36,17 @@ jobs: with: name: builds path: builds - - uses: actions/download-artifact@v4 - with: - name: tests - path: tests + - name: setup data + run: | + cd tests/data && bash setup.bash + export ILIAD_FILE=${PWD}/tests/data/iliad.data - name: test run: | - export ILIAD_FILE="tests/iliad.data" cd builds/build chmod +x tests/tests tests/tests - name: test_ubsan run: | - export ILIAD_FILE="tests/iliad.data" cd builds/build_ubsan chmod +x tests/tests tests/tests diff --git a/tests/data/setup.bash b/tests/data/setup.bash index 1e47c87..3b11eff 100644 --- a/tests/data/setup.bash +++ b/tests/data/setup.bash @@ -3,3 +3,4 @@ set -eEx ILIAD_REF="https://www.gutenberg.org/cache/epub/2199/pg2199.txt" ILIAD_FILE=${PWD}/"iliad.data" wget ${ILIAD_REF} -O ${ILIAD_FILE} +export ILIAD_FILE=${ILIAD_FILE} diff --git a/tests/streaming.cpp b/tests/streaming.cpp index e19cfb4..a83b302 100644 --- a/tests/streaming.cpp +++ b/tests/streaming.cpp @@ -8,6 +8,7 @@ #include #include #include +#include const std::vector test_words = {"The", "question", "is", "not", "where", "but", "when"}; @@ -48,6 +49,8 @@ void fill_answer(std::istream& in) { TEST(StreamingTests, CountMinSketch) { std::string iliad_file = std::getenv("ILIAD_FILE"); + std::filesystem::path p{iliad_file.c_str()}; + EXPECT_TRUE(std::filesystem::exists(p)); std::cout << "using iliad file: " << iliad_file << "\n"; { /// fill answer std::ifstream iliad(iliad_file); From 0ddc637ae9fff4880db8e160cd4efcdd8dfecb7d Mon Sep 17 00:00:00 2001 From: codeworse Date: Sat, 14 Jun 2025 12:19:07 +0000 Subject: [PATCH 2/3] fix --- .github/workflows/c-cpp.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index e4600d4..dd45926 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -5,7 +5,6 @@ on: branches: ["main"] pull_request: branches: ["main"] - jobs: build: runs-on: ubuntu-latest @@ -30,6 +29,8 @@ jobs: test: runs-on: ubuntu-latest needs: build + env: + ILIAD_TEST: tests/data/iliad.data steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 @@ -39,14 +40,16 @@ jobs: - name: setup data run: | cd tests/data && bash setup.bash - export ILIAD_FILE=${PWD}/tests/data/iliad.data - name: test run: | + export ILIAD_FILE=${PWD}/$ILIAD_TEST cd builds/build chmod +x tests/tests tests/tests + - name: test_ubsan run: | + export ILIAD_FILE=${PWD}/$ILIAD_TEST cd builds/build_ubsan chmod +x tests/tests tests/tests From 8971cfbee68ae057f2188d31dd3f3e81f3bea3a6 Mon Sep 17 00:00:00 2001 From: codeworse Date: Sat, 14 Jun 2025 12:23:17 +0000 Subject: [PATCH 3/3] fix format --- tests/streaming.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/streaming.cpp b/tests/streaming.cpp index a83b302..28bf8e6 100644 --- a/tests/streaming.cpp +++ b/tests/streaming.cpp @@ -4,11 +4,11 @@ #include #include #include +#include #include #include #include #include -#include const std::vector test_words = {"The", "question", "is", "not", "where", "but", "when"};