Skip to content

Commit

Permalink
[ci] Add targets to bundle tests and add a script to run them in Helix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
akoeplinger committed Nov 13, 2018
1 parent dcc2d17 commit c408741
Show file tree
Hide file tree
Showing 18 changed files with 483 additions and 7 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip foreign subdir-objects]
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE
AM_EXTRA_RECURSIVE_TARGETS([test])
AM_EXTRA_RECURSIVE_TARGETS([test-bundle])

API_VER=2.0
AC_SUBST(API_VER)
Expand Down
2 changes: 2 additions & 0 deletions libgc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,5 @@ EXTRA_DIST += configure.host
if $(CPP) $< >$@ ; then :; else rm -f $@; fi

test:

test-bundle:
7 changes: 7 additions & 0 deletions mcs/errors/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(LOCAL

test-local: $(TEST_SUPPORT_FILES)

test-bundle:
mkdir -p $(TEST_BUNDLE_PATH)/tests/mcs-errors
cp -L -R dlls $(TEST_BUNDLE_PATH)/tests/mcs-errors/
cp -L *.cs *.inc *.dll *.snk *.pub $(TEST_BUNDLE_PATH)/tests/mcs-errors/
cp -L $(topdir)/class/lib/$(PROFILE)/compiler-tester.* $(TEST_BUNDLE_PATH)/tests/mcs-errors/
cp -L known-issues-$(PROFILE) $(TEST_BUNDLE_PATH)/tests/mcs-errors/known-issues-$(PROFILE)

run-mcs-tests: test-local
$(TESTER) -mode:neg -files:$(TEST_PATTERN) -compiler:$(COMPILER) -reference-dir:$(topdir)/class/lib/$(PROFILE) -issues:known-issues-$(PROFILE) -log:$(PROFILE).log $(TESTER_OPTIONS) $(TOPTIONS)

Expand Down
4 changes: 4 additions & 0 deletions mcs/packages/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ test-csi:
cat csi-test-output.txt && grep -q "hello world" csi-test-output.txt
rm csi-test-output.txt

test-bundle:
mkdir -p $(TEST_BUNDLE_PATH)/tests/csi
cp -L $(ROSLYN_CSC_DIR)/* $(TEST_BUNDLE_PATH)/tests/csi/

endif

dist-local: dist-default
8 changes: 8 additions & 0 deletions mcs/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ run-test-local: test-local qcheck

check: run-test-local

test-bundle:
mkdir -p $(TEST_BUNDLE_PATH)/tests/mcs
cp -L -R dlls $(TEST_BUNDLE_PATH)/tests/mcs/
cp -L *.cs *.xml *.inc *.dll *.snk $(TEST_BUNDLE_PATH)/tests/mcs/
cp -L $(topdir)/class/lib/$(PROFILE)/compiler-tester.* $(TEST_BUNDLE_PATH)/tests/mcs/
cp -L $(KNOWN_ISSUES) $(TEST_BUNDLE_PATH)/tests/mcs/$(KNOWN_ISSUES)
cp -L ver-il-$(PROFILE).xml $(TEST_BUNDLE_PATH)/tests/mcs/ver-il-$(PROFILE).xml

endif

clean-local:
Expand Down
4 changes: 4 additions & 0 deletions mcs/tools/mono-symbolicate/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ AOT_SUPPORTED = $(shell $(MONO) --aot 2>&1 | grep -q "AOT compilation is not sup

test-local: $(TEST_EXE)

test-bundle:
mkdir -p $(TEST_BUNDLE_PATH)/tests/symbolicate
cp -L $(TEST_EXE) $(TEST_EXE:.exe=.pdb) $(SYMBOLICATE_EXPECTED_FILE) $(TEST_BUNDLE_PATH)/tests/symbolicate/

$(TEST_EXE): $(TEST_CS)
$(CSCOMPILE) $(TEST_CS) -r:$(LIB_PATH)/mscorlib.dll -r:$(LIB_PATH)/System.Core.dll -warn:0 -out:$(TEST_EXE)

Expand Down
4 changes: 4 additions & 0 deletions mono/btls/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ if HOST_WIN32
else
$(install_sh) build-shared/libmono-btls-shared.* "$(DESTDIR)$(libdir)"
endif

test-bundle-local:
mkdir -p $(TEST_BUNDLE_PATH)
cp -L build-shared/libmono-btls-shared$(libsuffix) $(TEST_BUNDLE_PATH)/
10 changes: 10 additions & 0 deletions mono/mini/Makefile.am.in
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,16 @@ testi: mono test.exe

test-local: $(regtests)

test-bundle-local:
mkdir -p $(TEST_BUNDLE_PATH)/tests/mini
cp -L $(regtests) TestDriver.dll MemoryIntrinsics.dll generics-variant-types.dll $(TEST_BUNDLE_PATH)/tests/mini/
cp -L mono-sgen $(TEST_BUNDLE_PATH)/
chmod +x $(TEST_BUNDLE_PATH)/mono-sgen
if SUPPORT_BOEHM
cp -L mono-boehm $(TEST_BUNDLE_PATH)/
chmod +x $(TEST_BUNDLE_PATH)/mono-boehm
endif

# ensure the tests are actually correct
checktests: $(regtests)
for i in $(regtests); do $(MINI_RUNTIME) $$i; done
Expand Down
4 changes: 3 additions & 1 deletion mono/native/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,6 @@ libmono_native_unified_la_LDFLAGS = $(MONO_NATIVE_UNIFIED_LDFLAGS)

libmono_native_unified_la_LIBADD = $(MONO_NATIVE_LIBADD)


test-bundle-local:
mkdir -p $(TEST_BUNDLE_PATH)
cp -L .libs/libmono-native$(libsuffix) $(TEST_BUNDLE_PATH)/
8 changes: 8 additions & 0 deletions mono/profiler/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ MCS = $(TOOLS_RUNTIME) $(CSC) -lib:$(CLASS) -unsafe -nologo -noconfig -nowarn:01

test-local: $(PLOG_TESTS)

test-bundle-local:
mkdir -p $(TEST_BUNDLE_PATH)/tests/profiler/
cp -L .libs/libmono-profiler-log$(libsuffix) $(TEST_BUNDLE_PATH)/
cp -L $(PLOG_TESTS) $(TEST_BUNDLE_PATH)/tests/profiler/
cp -L ptestrunner.pl $(TEST_BUNDLE_PATH)/tests/profiler/
cp -L mprof-report $(TEST_BUNDLE_PATH)/
chmod +x $(TEST_BUNDLE_PATH)/mprof-report

run-test: test
MONO_PATH=$(CLASS) perl $(srcdir)/ptestrunner.pl $(top_builddir) nunit TestResult-profiler.xml

Expand Down
11 changes: 8 additions & 3 deletions mono/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1996,13 +1996,18 @@ test-env-options:
MONO_ENV_OPTIONS="--version" $(RUNTIME) array-init.exe | grep -q Architecture:

TESTS_REGULAR = $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)

generate-regular-test-list:
@echo $(TESTS_REGULAR) > $(TEST_LIST_PATH)
TESTS_INCL_DEPS = $(shell find . -type f -name "*.exe" -o -name "*.dll" -o -name "*.netmodule" -o -name "*.config")

# Target to precompile the test executables
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

test-bundle-local:
mkdir -p $(addprefix $(TEST_BUNDLE_PATH)/tests/runtime/,$(sort $(dir $(TESTS_INCL_DEPS))))
@echo $(TESTS_REGULAR) > $(TEST_BUNDLE_PATH)/tests/runtime/runtime-test-list.txt
sed -e 's,$$mono_libdir,$$test_root_dir,g' tests-config > $(TEST_BUNDLE_PATH)/tests/runtime/tests-config.tmpl
cp -L .libs/libtest$(libsuffix) $(TEST_BUNDLE_PATH)/tests/runtime/
$(foreach asset,$(TESTS_INCL_DEPS),cp -L $(asset) $(TEST_BUNDLE_PATH)/tests/runtime/$(dir $(asset));)

# Precompile the test assemblies in parallel
compile-tests:
$(MAKE) -j4 test
Expand Down
2 changes: 2 additions & 0 deletions po/mcs/Makefile.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -445,3 +445,5 @@ force:
.NOEXPORT:

test:

test-bundle:
25 changes: 25 additions & 0 deletions runtime/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,31 @@ mcs-do-run-test-profiles: test-support-files
mcs-do-xunit-run-test-profiles: test-support-files
cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' run-xunit-test-profiles

test-bundle-local:
mkdir -p $(TEST_BUNDLE_PATH)/_tmpinst/bin
cp -L mono-test.sh $(TEST_BUNDLE_PATH)
cp -L -R etc $(TEST_BUNDLE_PATH)/_tmpinst
rm $(TEST_BUNDLE_PATH)/_tmpinst/etc/mono/config
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
echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
echo '#! /bin/sh' > $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/al.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/mcs.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
echo '"$$MONO_EXECUTABLE" $$(dirname "$$MONO_EXECUTABLE")/net_4_x/ilasm.exe "$$@"' >> $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/al
chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/mcs
chmod +x $(TEST_BUNDLE_PATH)/_tmpinst/bin/ilasm
for profile in $(test_profiles); do \
cp -L -R $(mcs_topdir)/class/lib/$$profile $(TEST_BUNDLE_PATH); \
done
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/
cp -L $(top_srcdir)/external/xunit-binaries/xunit.execution.dotnet.dll $(TEST_BUNDLE_PATH)/net_4_x/tests/
$(MAKE) -C $(mcs_topdir)/tests test-bundle
$(MAKE) -C $(mcs_topdir)/errors test-bundle
$(MAKE) -C $(mcs_topdir)/packages test-bundle
$(MAKE) -C $(mcs_topdir)/tools/mono-symbolicate test-bundle

if HOST_WIN32
if CROSS_COMPILING
cur_dir_cmd = pwd
Expand Down
Loading

0 comments on commit c408741

Please sign in to comment.