From 5c81f4008e9c75f4ac3c3ade4353a8aeaf5be182 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Fri, 13 Jun 2025 17:14:39 +0200 Subject: [PATCH 1/4] Unset CLICOLOR_FORCE for rewatch tests --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4ff7e1d89..8a9ea0d25f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,7 @@ jobs: run: | cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch mkdir -p rewatch/target/release - cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch/target/release + cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch/target/release ./scripts/copyExes.js --rewatch shell: bash @@ -360,6 +360,8 @@ jobs: run: make -C tests/gentype_tests/typescript-react-example clean test - name: Run rewatch tests + env: + CLICOLOR_FORCE: 0 run: make test-rewatch - name: Run syntax benchmarks From a91c6ee8421792ba09b6974f24de5f3e68a7258e Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Fri, 13 Jun 2025 16:47:25 +0200 Subject: [PATCH 2/4] Do not invoke "bash" without specifying its full path --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index dcc4fc7550..b7e40c7336 100644 --- a/Makefile +++ b/Makefile @@ -31,26 +31,26 @@ test: build lib test-analysis: make -C tests/analysis_tests clean test - + test-tools: make -C tests/tools_tests clean test test-syntax: - bash ./scripts/test_syntax.sh - bash ./scripts/testok.sh + ./scripts/test_syntax.sh + ./scripts/testok.sh test-syntax-roundtrip: - ROUNDTRIP_TEST=1 bash ./scripts/test_syntax.sh - bash ./scripts/testok.sh + ROUNDTRIP_TEST=1 ./scripts/test_syntax.sh + ./scripts/testok.sh test-gentype: make -C tests/gentype_tests/typescript-react-example clean test test-rewatch: - bash ./rewatch/tests/suite-ci.sh + ./rewatch/tests/suite-ci.sh test-rewatch-integration: - bash ./rewatch/tests/suite-ci.sh node_modules/.bin/rewatch + ./rewatch/tests/suite-ci.sh node_modules/.bin/rewatch test-all: test test-gentype test-analysis test-tools test-rewatch @@ -82,10 +82,10 @@ playground-release: playground playground-cmijs yarn workspace playground upload-bundle format: - bash scripts/format.sh + ./scripts/format.sh checkformat: - bash scripts/format_check.sh + ./scripts/format_check.sh clean-gentype: make -C tests/gentype_tests/typescript-react-example clean @@ -97,7 +97,7 @@ clean: (cd runtime && ../cli/rescript.js clean) dune clean -clean-all: clean clean-gentype clean-rewatch +clean-all: clean clean-gentype clean-rewatch dev-container: docker build -t rescript-dev-container docker From 0a877dd9a182d3ce4be3f9c348aff6ddc8252b6a Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sat, 14 Jun 2025 06:04:48 +0200 Subject: [PATCH 3/4] Fix --- .github/workflows/ci.yml | 16 +++++++--------- Makefile | 2 -- scripts/test_syntax.sh | 2 ++ scripts/testok.sh | 6 ------ 4 files changed, 9 insertions(+), 17 deletions(-) delete mode 100755 scripts/testok.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a9ea0d25f..eca1f5f240 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -321,13 +321,11 @@ jobs: if: steps.ninja-build-cache.outputs.cache-hit != 'true' run: node scripts/copyExes.js --ninja - - name: "Syntax: Run roundtrip tests" - if: ${{ runner.os != 'Windows' }} - run: opam exec -- make test-syntax-roundtrip - - - name: "Syntax: Run tests (Windows)" - if: ${{ runner.os == 'Windows' }} - run: opam exec -- make test-syntax + - name: "Syntax: Run tests" + env: + ROUNDTRIP_TEST: ${{ runner.os == 'Windows' && '0' || '1' }} + run: ./scripts/test_syntax.sh + shell: bash - name: Build runtime/stdlib with rewatch if: ${{ runner.os != 'Windows' }} @@ -362,7 +360,8 @@ jobs: - name: Run rewatch tests env: CLICOLOR_FORCE: 0 - run: make test-rewatch + run: ./rewatch/tests/suite-ci.sh + shell: bash - name: Run syntax benchmarks if: matrix.benchmarks @@ -526,7 +525,6 @@ jobs: working-directory: rewatch/testrepo - name: Run rewatch integration tests - # Currently failing on Windows and intermittently on macOS run: make test-rewatch-integration publish: diff --git a/Makefile b/Makefile index b7e40c7336..85b08bb1f4 100644 --- a/Makefile +++ b/Makefile @@ -37,11 +37,9 @@ test-tools: test-syntax: ./scripts/test_syntax.sh - ./scripts/testok.sh test-syntax-roundtrip: ROUNDTRIP_TEST=1 ./scripts/test_syntax.sh - ./scripts/testok.sh test-gentype: make -C tests/gentype_tests/typescript-react-example clean test diff --git a/scripts/test_syntax.sh b/scripts/test_syntax.sh index d3d735825e..85f09f7d57 100755 --- a/scripts/test_syntax.sh +++ b/scripts/test_syntax.sh @@ -117,3 +117,5 @@ fi rm -r temp/ popd + +printf "${successGreen}✅ All syntax tests passed.${reset}\n" diff --git a/scripts/testok.sh b/scripts/testok.sh deleted file mode 100755 index c65295f062..0000000000 --- a/scripts/testok.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -successGreen='\033[0;32m' -reset='\033[0m' - -printf "${successGreen}✅ All Tests Passed${reset}\n" From 107ba6f17c0c5225fba6ce4e76fe73caa8890d72 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sat, 14 Jun 2025 07:15:31 +0200 Subject: [PATCH 4/4] Fix --- .github/workflows/ci.yml | 5 ++--- Makefile | 3 --- rewatch/tests/suite-ci.sh | 7 +++++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eca1f5f240..58cd030dc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -358,8 +358,6 @@ jobs: run: make -C tests/gentype_tests/typescript-react-example clean test - name: Run rewatch tests - env: - CLICOLOR_FORCE: 0 run: ./rewatch/tests/suite-ci.sh shell: bash @@ -525,7 +523,8 @@ jobs: working-directory: rewatch/testrepo - name: Run rewatch integration tests - run: make test-rewatch-integration + run: ./rewatch/tests/suite-ci.sh node_modules/.bin/rewatch + shell: bash publish: needs: diff --git a/Makefile b/Makefile index 85b08bb1f4..032b80f314 100644 --- a/Makefile +++ b/Makefile @@ -47,9 +47,6 @@ test-gentype: test-rewatch: ./rewatch/tests/suite-ci.sh -test-rewatch-integration: - ./rewatch/tests/suite-ci.sh node_modules/.bin/rewatch - test-all: test test-gentype test-analysis test-tools test-rewatch reanalyze: diff --git a/rewatch/tests/suite-ci.sh b/rewatch/tests/suite-ci.sh index 87fd645cb5..d36319b988 100755 --- a/rewatch/tests/suite-ci.sh +++ b/rewatch/tests/suite-ci.sh @@ -1,4 +1,7 @@ #!/bin/bash + +unset CLICOLOR_FORCE + # Make sure we are in the right directory cd $(dirname $0) @@ -23,11 +26,11 @@ git checkout ../testrepo/package.json &> /dev/null success "Reset package.json and yarn.lock" bold "Make sure the testrepo is clean" -if git diff --exit-code ../testrepo &> diff.txt; +if git diff --exit-code ../testrepo &> diff.txt; then rm diff.txt success "Testrepo has no changes" -else +else error "Testrepo is not clean to start with" cat diff.txt rm diff.txt