Skip to content

Commit 55756a0

Browse files
committed
More Makefile fixes (test dependencies, test-rewatch)
1 parent 657ba7d commit 55756a0

File tree

11 files changed

+70
-83
lines changed

11 files changed

+70
-83
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ jobs:
363363
shell: bash
364364

365365
- name: Run rewatch tests
366-
run: ./rewatch/tests/suite-ci.sh
366+
run: ./rewatch/tests/suite.sh rewatch/target/release/rescript
367367
shell: bash
368368

369369
- name: Run syntax benchmarks
@@ -671,7 +671,7 @@ jobs:
671671
working-directory: rewatch/testrepo
672672

673673
- name: Run rewatch integration tests
674-
run: ./rewatch/tests/suite-ci.sh node_modules/.bin/rescript
674+
run: ./rewatch/tests/suite.sh node_modules/.bin/rescript
675675
shell: bash
676676

677677
publish:

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ make test-rewatch # Run integration tests
373373

374374
**Note**: The rewatch project is located in the `rewatch/` directory with its own `Cargo.toml` file. All cargo commands should be run from the project root using the `--manifest-path rewatch/Cargo.toml` flag, as shown in the CI workflow.
375375

376-
**Integration Tests**: The `make test-rewatch` command runs bash-based integration tests located in `rewatch/tests/suite-ci.sh`. These tests use the `rewatch/testrepo/` directory as a test workspace with various package configurations to verify rewatch's behavior across different scenarios.
376+
**Integration Tests**: The `make test-rewatch` command runs bash-based integration tests located in `rewatch/tests/suite.sh`. These tests use the `rewatch/testrepo/` directory as a test workspace with various package configurations to verify rewatch's behavior across different scenarios.
377377

378378
#### Debugging
379379

Makefile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,35 +148,37 @@ clean-lib:
148148
yarn workspace @rescript/runtime rescript clean
149149
rm -f $(RUNTIME_BUILD_STAMP)
150150

151-
# Tests / artifacts / analysis
151+
# Artifact list
152152

153153
artifacts: lib
154154
./scripts/updateArtifactList.js
155155

156-
bench: $(COMPILER_BUILD_STAMP)
156+
# Tests
157+
158+
bench: compiler
157159
$(DUNE_BIN_DIR)/syntax_benchmarks
158160

159-
test: lib ninja | $(YARN_INSTALL_STAMP)
161+
test: lib ninja
160162
node scripts/test.js -all
161163

162-
test-analysis: | $(YARN_INSTALL_STAMP)
164+
test-analysis: lib ninja
163165
make -C tests/analysis_tests clean test
164166

165-
test-tools: | $(YARN_INSTALL_STAMP)
167+
test-tools: lib ninja
166168
make -C tests/tools_tests clean test
167169

168-
test-syntax: | $(YARN_INSTALL_STAMP)
170+
test-syntax: compiler
169171
./scripts/test_syntax.sh
170172

171-
test-syntax-roundtrip: | $(YARN_INSTALL_STAMP)
173+
test-syntax-roundtrip: compiler
172174
ROUNDTRIP_TEST=1 ./scripts/test_syntax.sh
173175

174-
test-gentype: | $(YARN_INSTALL_STAMP)
176+
test-gentype: lib ninja
175177
make -C tests/gentype_tests/typescript-react-example clean test
176178
make -C tests/gentype_tests/stdlib-no-shims clean test
177179

178-
test-rewatch: $(RESCRIPT_EXE) | $(YARN_INSTALL_STAMP)
179-
./rewatch/tests/suite-ci.sh
180+
test-rewatch: lib
181+
./rewatch/tests/suite.sh $(RESCRIPT_EXE)
180182

181183
test-all: test test-gentype test-analysis test-tools test-rewatch
182184

rewatch/tests/clean.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ else
1717
fi
1818

1919
# Then we clean a single project
20-
error_output=$(cd packages/file-casing && "../../$REWATCH_EXECUTABLE" clean 2>&1)
20+
error_output=$(cd packages/file-casing && "$REWATCH_EXECUTABLE" clean 2>&1)
2121
clean_status=$?
2222
if [ $clean_status -ne 0 ];
2323
then
@@ -86,7 +86,7 @@ fi
8686
bold "Test: It should clean dependencies from node_modules"
8787

8888
# Build a package with external dependencies
89-
error_output=$(cd packages/with-dev-deps && "../../$REWATCH_EXECUTABLE" build 2>&1)
89+
error_output=$(cd packages/with-dev-deps && "$REWATCH_EXECUTABLE" build 2>&1)
9090
if [ $? -eq 0 ];
9191
then
9292
success "Built with-dev-deps"
@@ -97,7 +97,7 @@ else
9797
fi
9898

9999
# Then we clean a single project
100-
error_output=$(cd packages/with-dev-deps && "../../$REWATCH_EXECUTABLE" clean 2>&1)
100+
error_output=$(cd packages/with-dev-deps && "$REWATCH_EXECUTABLE" clean 2>&1)
101101
clean_status=$?
102102
if [ $clean_status -ne 0 ];
103103
then

rewatch/tests/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fi
3737
# Build from standalone package folder using `rescript build`
3838
bold "Test: Standalone package can build via rescript from package folder"
3939
pushd ./packages/standalone > /dev/null
40-
error_output=$("../../$REWATCH_EXECUTABLE" build 2>&1)
40+
error_output=$("$REWATCH_EXECUTABLE" build 2>&1)
4141
if [ $? -eq 0 ];
4242
then
4343
success "Standalone package built"

rewatch/tests/compiler-args.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ cd ../testrepo
66
bold "Test: It should not matter where we grab the compiler-args for a file"
77
# Capture stdout for both invocations
88
stdout_root=$(rewatch compiler-args packages/file-casing/src/Consume.res 2>/dev/null)
9-
stdout_pkg=$(cd packages/file-casing && "../../$REWATCH_EXECUTABLE" compiler-args src/Consume.res 2>/dev/null)
9+
stdout_pkg=$(cd packages/file-casing && "$REWATCH_EXECUTABLE" compiler-args src/Consume.res 2>/dev/null)
1010

1111
error_output=$(rewatch compiler-args packages/file-casing/src/Consume.res 2>&1)
1212
if [ $? -ne 0 ]; then
1313
error "Error grabbing compiler args for packages/file-casing/src/Consume.res"
1414
printf "%s\n" "$error_output" >&2
1515
exit 1
1616
fi
17-
error_output=$(cd packages/file-casing && "../../$REWATCH_EXECUTABLE" compiler-args src/Consume.res 2>&1)
17+
error_output=$(cd packages/file-casing && "$REWATCH_EXECUTABLE" compiler-args src/Consume.res 2>&1)
1818
if [ $? -ne 0 ]; then
1919
error "Error grabbing compiler args for src/Consume.res in packages/file-casing"
2020
printf "%s\n" "$error_output" >&2

rewatch/tests/format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fi
4545

4646
bold "Test: It should format only the current project"
4747

48-
error_output=$(cd packages/file-casing && "../../$REWATCH_EXECUTABLE" format)
48+
error_output=$(cd packages/file-casing && "$REWATCH_EXECUTABLE" format)
4949
git_diff_file_count=$(git diff --name-only ./ | wc -l | xargs)
5050
if [ $? -eq 0 ] && [ $git_diff_file_count -eq 2 ];
5151
then

rewatch/tests/get_bin_paths.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

rewatch/tests/get_runtime_path.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// @ts-check
2+
import { runtimePath } from "../../cli/common/runtime.js";
3+
4+
console.log(`RESCRIPT_RUNTIME='${runtimePath}'`);

rewatch/tests/suite-ci.sh

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)