From a8a4d9138311b2e94940a6407423255b2c866f94 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Sat, 2 Jul 2022 12:07:17 -0400 Subject: [PATCH 1/5] tests: Update utility to return test job attributes --- tests/executest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/executest.py b/tests/executest.py index 2eeb33cb9c5..2bb1f055033 100755 --- a/tests/executest.py +++ b/tests/executest.py @@ -29,6 +29,7 @@ def _json_object_hook(d): parser.add_argument("jobid") parser.add_argument("-d", "--description", default=False, action="store_true", help="Print job description") parser.add_argument("-c", "--command", default=False, action="store_true", help="Print command") + parser.add_argument("-a", "--attribute", default='', choices=JobInfo._fields + ('fullpath', ), help="Print job's attribute") args = parser.parse_args() joblist_file = os.path.join(os.path.dirname(__file__), "joblist.json") @@ -40,3 +41,8 @@ def _json_object_hook(d): if job.jobid != args.jobid: continue if args.description: print("{descr}".format(**job._asdict())) if args.command: print("root4star -b -q -l \'bfc.C({nevents}, \"{chopts}\", \"{inppath}/{inpfile}\")\'".format(**job._asdict())) + if args.attribute: + if args.attribute == 'fullpath': + print("{}/{}".format(job.inppath, job.inpfile)) + else: + print(job._asdict()[args.attribute]) From 17c4a04576f94d1afc69ac26efa2102de9d85d1e Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Sat, 2 Jul 2022 12:08:29 -0400 Subject: [PATCH 2/5] ci: Run doEvents.C macro from StRoot/macros --- .github/workflows/build-pull-request.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index b7759c48924..e68d50d3b92 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -55,6 +55,28 @@ jobs: docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ sh -c "set -e; MALLOC_CHECK_=3 $TEST_CMD 2>&1 | tee log; grep 'Run completed' log" + ROOT5_test_macros: + runs-on: ubuntu-latest + needs: build + strategy: + matrix: + test_id: [102, 103] + env: + STARENV: root5-gcc485 + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp + + - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar + - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v4 + - run: | + TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/') + TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/doEvents.C(100, \"$TEST_FILE\")'" + docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} sh -c "$TEST_CMD" + ROOT6_test_ignore_fail: runs-on: ubuntu-latest needs: build From 2e5fe67c8dc22957f63f8f9d772cc79dfad9c033 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Sat, 2 Jul 2022 12:14:35 -0400 Subject: [PATCH 3/5] ci: Run find_vertex.C macro from StRoot/macros --- .github/workflows/build-pull-request.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index e68d50d3b92..dae33fd7218 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -77,6 +77,29 @@ jobs: TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/doEvents.C(100, \"$TEST_FILE\")'" docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} sh -c "$TEST_CMD" + ROOT5_test_find_vertex: + runs-on: ubuntu-latest + needs: build + strategy: + matrix: + test_id: [102] + env: + STARENV: root5-gcc485 + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp + + - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar + - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v4 + - run: | + TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/') + TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/find_vertex.C(\"$TEST_FILE\")'" + docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ + sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep 'This is the end of STAR ROOT -- Goodbye' log" + ROOT6_test_ignore_fail: runs-on: ubuntu-latest needs: build From 7c738631ec979e149fa6990420e4520780e3249c Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 5 Jul 2022 14:02:40 -0400 Subject: [PATCH 4/5] Grep log file to send an appropriate exit code --- .github/workflows/build-pull-request.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index dae33fd7218..12ade95ccad 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -75,7 +75,8 @@ jobs: - run: | TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/') TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/doEvents.C(100, \"$TEST_FILE\")'" - docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} sh -c "$TEST_CMD" + docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ + sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep ' IO:' log" ROOT5_test_find_vertex: runs-on: ubuntu-latest @@ -98,7 +99,7 @@ jobs: TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/') TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/find_vertex.C(\"$TEST_FILE\")'" docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ - sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep 'This is the end of STAR ROOT -- Goodbye' log" + sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep ' IO:' log" ROOT6_test_ignore_fail: runs-on: ubuntu-latest From 895ddecfa829ac62c4006a2d6783d2aa630390a9 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Wed, 6 Jul 2022 16:41:39 -0400 Subject: [PATCH 5/5] Fix find_vertex.C to make ROOT interpreter happy --- StRoot/macros/analysis/find_vertex.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/StRoot/macros/analysis/find_vertex.C b/StRoot/macros/analysis/find_vertex.C index 2c02dd0dd4d..d381a13f2d8 100644 --- a/StRoot/macros/analysis/find_vertex.C +++ b/StRoot/macros/analysis/find_vertex.C @@ -23,6 +23,8 @@ class StChain; class StMinuitVertexFinder; class StGenericVertexFinder; class StGenericVertexMaker; +class StEvent; +class StPrimaryVertex; StChain *chain=0; TH1F *dca_z_h=0; @@ -122,6 +124,7 @@ void find_vertex(char * fname="high_053/st_physics_6053108_raw_2020002.event.roo gSystem->Load("Sti"); gSystem->Load("libStEEmcUtil"); + gSystem->Load("libMinuit"); gSystem->Load("StGenericVertexMaker"); TFile *fout = new TFile("vtx_tree.root","RECREATE");