Skip to content

Commit c408741

Browse files
committed
[ci] Add targets to bundle tests and add a script to run them in Helix
The test-bundle target copies all assets needed for test execution to a specified directory. We upload this directory to Helix and use it to run our mainline tests.
1 parent dcc2d17 commit c408741

File tree

18 files changed

+483
-7
lines changed

18 files changed

+483
-7
lines changed

configure.ac

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip foreign subdir-objects]
2121
AC_CONFIG_HEADERS([config.h])
2222
AM_MAINTAINER_MODE
2323
AM_EXTRA_RECURSIVE_TARGETS([test])
24+
AM_EXTRA_RECURSIVE_TARGETS([test-bundle])
2425

2526
API_VER=2.0
2627
AC_SUBST(API_VER)

libgc/Makefile.am

+2
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,5 @@ EXTRA_DIST += configure.host
186186
if $(CPP) $< >$@ ; then :; else rm -f $@; fi
187187

188188
test:
189+
190+
test-bundle:

mcs/errors/Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(LOCAL
6262

6363
test-local: $(TEST_SUPPORT_FILES)
6464

65+
test-bundle:
66+
mkdir -p $(TEST_BUNDLE_PATH)/tests/mcs-errors
67+
cp -L -R dlls $(TEST_BUNDLE_PATH)/tests/mcs-errors/
68+
cp -L *.cs *.inc *.dll *.snk *.pub $(TEST_BUNDLE_PATH)/tests/mcs-errors/
69+
cp -L $(topdir)/class/lib/$(PROFILE)/compiler-tester.* $(TEST_BUNDLE_PATH)/tests/mcs-errors/
70+
cp -L known-issues-$(PROFILE) $(TEST_BUNDLE_PATH)/tests/mcs-errors/known-issues-$(PROFILE)
71+
6572
run-mcs-tests: test-local
6673
$(TESTER) -mode:neg -files:$(TEST_PATTERN) -compiler:$(COMPILER) -reference-dir:$(topdir)/class/lib/$(PROFILE) -issues:known-issues-$(PROFILE) -log:$(PROFILE).log $(TESTER_OPTIONS) $(TOPTIONS)
6774

mcs/packages/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ test-csi:
5757
cat csi-test-output.txt && grep -q "hello world" csi-test-output.txt
5858
rm csi-test-output.txt
5959

60+
test-bundle:
61+
mkdir -p $(TEST_BUNDLE_PATH)/tests/csi
62+
cp -L $(ROSLYN_CSC_DIR)/* $(TEST_BUNDLE_PATH)/tests/csi/
63+
6064
endif
6165

6266
dist-local: dist-default

mcs/tests/Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ run-test-local: test-local qcheck
8686

8787
check: run-test-local
8888

89+
test-bundle:
90+
mkdir -p $(TEST_BUNDLE_PATH)/tests/mcs
91+
cp -L -R dlls $(TEST_BUNDLE_PATH)/tests/mcs/
92+
cp -L *.cs *.xml *.inc *.dll *.snk $(TEST_BUNDLE_PATH)/tests/mcs/
93+
cp -L $(topdir)/class/lib/$(PROFILE)/compiler-tester.* $(TEST_BUNDLE_PATH)/tests/mcs/
94+
cp -L $(KNOWN_ISSUES) $(TEST_BUNDLE_PATH)/tests/mcs/$(KNOWN_ISSUES)
95+
cp -L ver-il-$(PROFILE).xml $(TEST_BUNDLE_PATH)/tests/mcs/ver-il-$(PROFILE).xml
96+
8997
endif
9098

9199
clean-local:

mcs/tools/mono-symbolicate/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ AOT_SUPPORTED = $(shell $(MONO) --aot 2>&1 | grep -q "AOT compilation is not sup
5858

5959
test-local: $(TEST_EXE)
6060

61+
test-bundle:
62+
mkdir -p $(TEST_BUNDLE_PATH)/tests/symbolicate
63+
cp -L $(TEST_EXE) $(TEST_EXE:.exe=.pdb) $(SYMBOLICATE_EXPECTED_FILE) $(TEST_BUNDLE_PATH)/tests/symbolicate/
64+
6165
$(TEST_EXE): $(TEST_CS)
6266
$(CSCOMPILE) $(TEST_CS) -r:$(LIB_PATH)/mscorlib.dll -r:$(LIB_PATH)/System.Core.dll -warn:0 -out:$(TEST_EXE)
6367

mono/btls/Makefile.am

+4
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,7 @@ if HOST_WIN32
8080
else
8181
$(install_sh) build-shared/libmono-btls-shared.* "$(DESTDIR)$(libdir)"
8282
endif
83+
84+
test-bundle-local:
85+
mkdir -p $(TEST_BUNDLE_PATH)
86+
cp -L build-shared/libmono-btls-shared$(libsuffix) $(TEST_BUNDLE_PATH)/

mono/mini/Makefile.am.in

+10
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,16 @@ testi: mono test.exe
805805

806806
test-local: $(regtests)
807807

808+
test-bundle-local:
809+
mkdir -p $(TEST_BUNDLE_PATH)/tests/mini
810+
cp -L $(regtests) TestDriver.dll MemoryIntrinsics.dll generics-variant-types.dll $(TEST_BUNDLE_PATH)/tests/mini/
811+
cp -L mono-sgen $(TEST_BUNDLE_PATH)/
812+
chmod +x $(TEST_BUNDLE_PATH)/mono-sgen
813+
if SUPPORT_BOEHM
814+
cp -L mono-boehm $(TEST_BUNDLE_PATH)/
815+
chmod +x $(TEST_BUNDLE_PATH)/mono-boehm
816+
endif
817+
808818
# ensure the tests are actually correct
809819
checktests: $(regtests)
810820
for i in $(regtests); do $(MINI_RUNTIME) $$i; done

mono/native/Makefile.am

+3-1
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,6 @@ libmono_native_unified_la_LDFLAGS = $(MONO_NATIVE_UNIFIED_LDFLAGS)
115115

116116
libmono_native_unified_la_LIBADD = $(MONO_NATIVE_LIBADD)
117117

118-
118+
test-bundle-local:
119+
mkdir -p $(TEST_BUNDLE_PATH)
120+
cp -L .libs/libmono-native$(libsuffix) $(TEST_BUNDLE_PATH)/

mono/profiler/Makefile.am

+8
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ MCS = $(TOOLS_RUNTIME) $(CSC) -lib:$(CLASS) -unsafe -nologo -noconfig -nowarn:01
161161

162162
test-local: $(PLOG_TESTS)
163163

164+
test-bundle-local:
165+
mkdir -p $(TEST_BUNDLE_PATH)/tests/profiler/
166+
cp -L .libs/libmono-profiler-log$(libsuffix) $(TEST_BUNDLE_PATH)/
167+
cp -L $(PLOG_TESTS) $(TEST_BUNDLE_PATH)/tests/profiler/
168+
cp -L ptestrunner.pl $(TEST_BUNDLE_PATH)/tests/profiler/
169+
cp -L mprof-report $(TEST_BUNDLE_PATH)/
170+
chmod +x $(TEST_BUNDLE_PATH)/mprof-report
171+
164172
run-test: test
165173
MONO_PATH=$(CLASS) perl $(srcdir)/ptestrunner.pl $(top_builddir) nunit TestResult-profiler.xml
166174

mono/tests/Makefile.am

+8-3
Original file line numberDiff line numberDiff line change
@@ -1996,13 +1996,18 @@ test-env-options:
19961996
MONO_ENV_OPTIONS="--version" $(RUNTIME) array-init.exe | grep -q Architecture:
19971997

19981998
TESTS_REGULAR = $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)
1999-
2000-
generate-regular-test-list:
2001-
@echo $(TESTS_REGULAR) > $(TEST_LIST_PATH)
1999+
TESTS_INCL_DEPS = $(shell find . -type f -name "*.exe" -o -name "*.dll" -o -name "*.netmodule" -o -name "*.config")
20022000

20032001
# Target to precompile the test executables
20042002
test-local: $(TESTS_REGULAR) $(TESTS_STRESS) $(TESTS_GSHARED) $(TESTSAOT_CS) $(TESTSAOT_IL) $(TESTSAOT_BENCH) $(TESTSAOT_STRESS) $(TESTSAOT_GSHARED) $(TESTS_TAILCALL) $(TESTSAOT_TAILCALL) compile-gac-loading compile-assembly-load-reference test-runner.exe
20052003

2004+
test-bundle-local:
2005+
mkdir -p $(addprefix $(TEST_BUNDLE_PATH)/tests/runtime/,$(sort $(dir $(TESTS_INCL_DEPS))))
2006+
@echo $(TESTS_REGULAR) > $(TEST_BUNDLE_PATH)/tests/runtime/runtime-test-list.txt
2007+
sed -e 's,$$mono_libdir,$$test_root_dir,g' tests-config > $(TEST_BUNDLE_PATH)/tests/runtime/tests-config.tmpl
2008+
cp -L .libs/libtest$(libsuffix) $(TEST_BUNDLE_PATH)/tests/runtime/
2009+
$(foreach asset,$(TESTS_INCL_DEPS),cp -L $(asset) $(TEST_BUNDLE_PATH)/tests/runtime/$(dir $(asset));)
2010+
20062011
# Precompile the test assemblies in parallel
20072012
compile-tests:
20082013
$(MAKE) -j4 test

po/mcs/Makefile.in.in

+2
Original file line numberDiff line numberDiff line change
@@ -445,3 +445,5 @@ force:
445445
.NOEXPORT:
446446

447447
test:
448+
449+
test-bundle:

runtime/Makefile.am

+25
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,31 @@ mcs-do-run-test-profiles: test-support-files
147147
mcs-do-xunit-run-test-profiles: test-support-files
148148
cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-xunit-test-profiles
149149

150+
test-bundle-local:
151+
mkdir -p $(TEST_BUNDLE_PATH)/_tmpinst/bin
152+
cp -L mono-test.sh $(TEST_BUNDLE_PATH)
153+
cp -L -R etc $(TEST_BUNDLE_PATH)/_tmpinst
154+
rm $(TEST_BUNDLE_PATH)/_tmpinst/etc/mono/config
155+
sed -e 's,$$mono_libdir,$$test_root_dir,g' -e 's,target="$(libgdiplus_install_loc)",target="$$test_root_dir/mono-libgdiplus$(libsuffix)",g' $(top_builddir)/data/config > $(TEST_BUNDLE_PATH)/_tmpinst/etc/mono/config.tmpl
156+
echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
157+
echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
158+
echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
159+
echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/al.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
160+
echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/mcs.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
161+
echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/ilasm.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
162+
chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
163+
chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
164+
chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
165+
for profile in $(test_profiles); do \
166+
cp -L -R $(mcs_topdir)/class/lib/$$profile $(TEST_BUNDLE_PATH); \
167+
done
168+
cp -L $(top_srcdir)/external/xunit-binaries/*.dll $(top_srcdir)/external/xunit-binaries/*.exe $(top_srcdir)/external/xunit-binaries/*.config $(TEST_BUNDLE_PATH)/net_4_x/
169+
cp -L $(top_srcdir)/external/xunit-binaries/xunit.execution.dotnet.dll $(TEST_BUNDLE_PATH)/net_4_x/tests/
170+
$(MAKE) -C $(mcs_topdir)/tests test-bundle
171+
$(MAKE) -C $(mcs_topdir)/errors test-bundle
172+
$(MAKE) -C $(mcs_topdir)/packages test-bundle
173+
$(MAKE) -C $(mcs_topdir)/tools/mono-symbolicate test-bundle
174+
150175
if HOST_WIN32
151176
if CROSS_COMPILING
152177
cur_dir_cmd = pwd

0 commit comments

Comments
 (0)