Skip to content

Commit 41f2dd6

Browse files
Merge branch 'main' into regular-benches
2 parents a322d85 + ca69ced commit 41f2dd6

109 files changed

Lines changed: 10430 additions & 1131 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/e2e.yml‎

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ on:
66
push:
77
branches:
88
- main
9-
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
1013
permissions:
1114
pull-requests: write
1215

@@ -22,6 +25,9 @@ jobs:
2225
env:
2326
REPORT_LOCAL_DIR: test-reports
2427
REPORT_LOCAL_FILE: wasm-e2e-report.html
28+
WASM_REPORT_JSON_FILE: wasm.json
29+
GRATE_REPORT_JSON_FILE: grates.json
30+
REPORT_HTML_IN_REPORTS: report.html
2531
COMMENT_LOCAL_FILE: e2e_comment.md
2632

2733
steps:
@@ -31,7 +37,7 @@ jobs:
3137
# First attempt at build
3238
- name: Build e2e (attempt 1)
3339
id: build_e2e_try1
34-
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
40+
uses: docker/build-push-action@601a80b39c9405e50806ae38af30926f9d957c47 # v6.19.1
3541
with:
3642
platforms: linux/amd64
3743
cache-from: type=gha
@@ -49,7 +55,7 @@ jobs:
4955
- name: Build e2e (attempt 2)
5056
id: build_e2e_try2
5157
if: steps.build_e2e_try1.outcome == 'failure'
52-
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
58+
uses: docker/build-push-action@601a80b39c9405e50806ae38af30926f9d957c47 # v6.19.1
5359
with:
5460
platforms: linux/amd64
5561
cache-from: type=gha
@@ -67,7 +73,7 @@ jobs:
6773
- name: Build e2e (attempt 3)
6874
id: build_e2e_try3
6975
if: steps.build_e2e_try2.outcome == 'failure'
70-
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
76+
uses: docker/build-push-action@601a80b39c9405e50806ae38af30926f9d957c47 # v6.19.1
7177
with:
7278
platforms: linux/amd64
7379
cache-from: type=gha
@@ -99,7 +105,35 @@ jobs:
99105
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
100106
with:
101107
name: wasm-e2e-report
102-
path: ${{ env.REPORT_LOCAL_DIR }}/${{ env.REPORT_LOCAL_FILE }}
108+
path: |
109+
${{ env.REPORT_LOCAL_DIR }}/reports/${{ env.REPORT_HTML_IN_REPORTS }}
110+
${{ env.REPORT_LOCAL_DIR }}/${{ env.REPORT_LOCAL_FILE }}
111+
if-no-files-found: error
112+
retention-days: 7
113+
114+
- name: Upload wasm JSON report artifact
115+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
116+
with:
117+
name: wasm-e2e-json
118+
path: ${{ env.REPORT_LOCAL_DIR }}/reports/${{ env.WASM_REPORT_JSON_FILE }}
119+
if-no-files-found: error
120+
retention-days: 7
121+
122+
- name: Upload grate JSON report artifact
123+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
124+
with:
125+
name: grate-e2e-json
126+
path: ${{ env.REPORT_LOCAL_DIR }}/reports/${{ env.GRATE_REPORT_JSON_FILE }}
127+
if-no-files-found: error
128+
retention-days: 7
129+
130+
- name: Upload unified runner HTML report artifact
131+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
132+
with:
133+
name: wasm-e2e-unified-html
134+
path: |
135+
${{ env.REPORT_LOCAL_DIR }}/reports/${{ env.REPORT_HTML_IN_REPORTS }}
136+
${{ env.REPORT_LOCAL_DIR }}/${{ env.REPORT_LOCAL_FILE }}
103137
if-no-files-found: error
104138
retention-days: 7
105139

@@ -120,4 +154,4 @@ jobs:
120154
if: steps.e2e.outputs.E2E_STATUS == 'fail'
121155
run: |
122156
echo "Tests failed; failing job after posting the report/comment."
123-
exit 1
157+
exit 1

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ results.json
2020
#Ignore local files
2121
.DS_Store
2222
target/
23+
#Ignore python cache
24+
__pycache__/

‎Docker/Dockerfile.e2e‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,13 @@ RUN install -D -m 0755 /scripts/lind_compile /usr/local/bin/lind_compile \
151151

152152
# Run all tests, print results, and exit with 1, if any test fails; 0 otherwise
153153
FROM base AS test
154+
ENV LIND_WASM_ROOT=/
154155
COPY --parents scripts tests tools skip_test_cases.txt Makefile .
155-
RUN chmod 0755 /scripts/wasmtestreport.py /scripts/lind_compile /scripts/lind_run
156+
RUN chmod 0755 /scripts/wasmtestreport.py /scripts/test_runner.py /scripts/lind_compile /scripts/lind_run \
157+
&& install -D -m 0755 /scripts/lind_compile /usr/local/bin/lind_compile \
158+
&& install -D -m 0755 /scripts/lind_run /usr/local/bin/lind_run \
159+
&& ln -sf /usr/local/bin/lind_compile /usr/local/bin/lind-clang \
160+
&& ln -sf /usr/local/bin/lind_run /usr/local/bin/lind-wasm
156161
# Create symlink so hardcoded paths in wasmtime match Docker environment
157162
RUN mkdir -p /home/lind && ln -sf / /home/lind/lind-wasm
158163
# NOTE: Build artifacts from prior stages are only mounted, to save COPY time
@@ -161,10 +166,11 @@ RUN --mount=from=build-lind-boot,source=src/lind-boot/target,destination=src/lin
161166
--mount=from=build-lind-boot,source=build/lind-boot,destination=/build/lind-boot \
162167
--mount=from=build-glibc,source=src/glibc/sysroot,destination=src/glibc/sysroot \
163168
make test && \
164-
OUT_DIR=/ REPORT_PATH=/report.html make md_generation
169+
make md_generation OUT=/ REPORT=/report.html
165170

166171

167172
FROM scratch AS artifacts
168173
COPY --from=test /report.html /wasm-e2e-report.html
174+
COPY --from=test /reports /reports
169175
COPY --from=test /e2e_comment.md /e2e_comment.md
170176
COPY --from=test /e2e_status /e2e_status

‎Makefile‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ LINDFS_DIRS := \
1111
tmp \
1212
usr/bin \
1313
usr/lib \
14+
usr/lib/locale \
1415
usr/local/bin \
16+
usr/share/zoneinfo \
1517
var \
1618
var/log \
1719
var/run
@@ -41,6 +43,8 @@ lindfs:
4143
done
4244
touch $(LINDFS_ROOT)/dev/null
4345
cp -rT scripts/lindfs-conf/etc $(LINDFS_ROOT)/etc
46+
cp -rT scripts/lindfs-conf/usr/lib/locale $(LINDFS_ROOT)/usr/lib/locale
47+
cp -rT scripts/lindfs-conf/usr/share/zoneinfo $(LINDFS_ROOT)/usr/share/zoneinfo
4448

4549
.PHONY: lind-debug
4650
lind-debug: build-dir
@@ -69,18 +73,17 @@ sync-sysroot:
6973

7074
.PHONY: test
7175
test: lindfs
72-
# NOTE: `grep` workaround required for lack of meaningful exit code in wasmtestreport.py
76+
# Unified harness entry point (run all discovered harnesses for e2e signal)
7377
LIND_WASM_BASE=. LINDFS_ROOT=$(LINDFS_ROOT) \
74-
./scripts/wasmtestreport.py --allow-pre-compiled && \
75-
cat results.json; \
76-
if grep -q '"number_of_failures": [^0]' results.json; then \
77-
echo "E2E_STATUS=fail" > e2e_status; \
78-
else \
78+
python3 ./scripts/test_runner.py --export-report report.html && \
79+
find reports -maxdepth 1 -name '*.json' -print -exec cat {} \;; \
80+
if python3 -c "import glob,json,sys; paths=glob.glob('reports/*.json'); total=sum(int(json.load(open(p)).get('number_of_failures', 0)) for p in paths); print(f'total_failures={total}'); sys.exit(1 if total else 0)"; then \
7981
echo "E2E_STATUS=pass" > e2e_status; \
82+
else \
83+
echo "E2E_STATUS=fail" > e2e_status; \
8084
fi; \
8185
exit 0
8286

83-
8487
.PHONY: md_generation
8588
OUT ?= .
8689
REPORT ?= report.html
@@ -142,5 +145,6 @@ clean:
142145
distclean: clean
143146
@echo "removing test outputs & temp files"
144147
$(RM) -f results.json report.html e2e_status
148+
$(RM) -r reports || true
145149
$(RM) -r $(LINDFS_ROOT)/testfiles || true
146-
find tests -type f \( -name '*.wasm' -o -name '*.cwasm' -o -name '*.o' \) -delete
150+
find tests -type f \( -name '*.wasm' -o -name '*.cwasm' -o -name '*.o' \) -delete

‎scripts/cargo-lind_compile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export CARGO_TARGET_WASM32_WASIP1_RUSTFLAGS="\
2929
-C link-arg=-Wl,--max-memory=67108864 \
3030
-C link-arg=-Wl,--export=__stack_pointer \
3131
-C link-arg=-Wl,--export=__stack_low \
32+
-C link-arg=-Wl,--export=__tls_base \
3233
-C link-arg=-Wl,--export=pass_fptr_to_wt"
3334

3435
# Set wasm-opt and wasmtime paths (allow override via environment variables)

‎scripts/harnesses/__init__.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Test harness modules for the unified test runner."""

0 commit comments

Comments
 (0)