diff --git a/cmd/builder/test/core.builder.yaml b/cmd/builder/test/core.builder.yaml index 618266d7449..f1c2b4dc2c8 100644 --- a/cmd/builder/test/core.builder.yaml +++ b/cmd/builder/test/core.builder.yaml @@ -11,67 +11,3 @@ receivers: exporters: - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.116.0 - -replaces: - - go.opentelemetry.io/collector => ${WORKSPACE_DIR} - - go.opentelemetry.io/collector/client => ${WORKSPACE_DIR}/client - - go.opentelemetry.io/collector/component => ${WORKSPACE_DIR}/component - - go.opentelemetry.io/collector/component/componenttest => ${WORKSPACE_DIR}/component/componenttest - - go.opentelemetry.io/collector/component/componentstatus => ${WORKSPACE_DIR}/component/componentstatus - - go.opentelemetry.io/collector/config/configauth => ${WORKSPACE_DIR}/config/configauth - - go.opentelemetry.io/collector/config/configcompression => ${WORKSPACE_DIR}/config/configcompression - - go.opentelemetry.io/collector/config/configgrpc => ${WORKSPACE_DIR}/config/configgrpc - - go.opentelemetry.io/collector/config/confighttp => ${WORKSPACE_DIR}/config/confighttp - - go.opentelemetry.io/collector/config/confignet => ${WORKSPACE_DIR}/config/confignet - - go.opentelemetry.io/collector/config/configopaque => ${WORKSPACE_DIR}/config/configopaque - - go.opentelemetry.io/collector/config/configretry => ${WORKSPACE_DIR}/config/configretry - - go.opentelemetry.io/collector/config/configtelemetry => ${WORKSPACE_DIR}/config/configtelemetry - - go.opentelemetry.io/collector/config/configtls => ${WORKSPACE_DIR}/config/configtls - - go.opentelemetry.io/collector/confmap => ${WORKSPACE_DIR}/confmap - - go.opentelemetry.io/collector/confmap/provider/envprovider => ${WORKSPACE_DIR}/confmap/provider/envprovider - - go.opentelemetry.io/collector/confmap/provider/fileprovider => ${WORKSPACE_DIR}/confmap/provider/fileprovider - - go.opentelemetry.io/collector/confmap/provider/httpprovider => ${WORKSPACE_DIR}/confmap/provider/httpprovider - - go.opentelemetry.io/collector/confmap/provider/httpsprovider => ${WORKSPACE_DIR}/confmap/provider/httpsprovider - - go.opentelemetry.io/collector/confmap/provider/yamlprovider => ${WORKSPACE_DIR}/confmap/provider/yamlprovider - - go.opentelemetry.io/collector/consumer => ${WORKSPACE_DIR}/consumer - - go.opentelemetry.io/collector/consumer/consumererror => ${WORKSPACE_DIR}/consumer/consumererror - - go.opentelemetry.io/collector/consumer/consumererror/xconsumererror => ${WORKSPACE_DIR}/consumer/consumererror/xconsumererror - - go.opentelemetry.io/collector/consumer/xconsumer => ${WORKSPACE_DIR}/consumer/xconsumer - - go.opentelemetry.io/collector/consumer/consumertest => ${WORKSPACE_DIR}/consumer/consumertest - - go.opentelemetry.io/collector/connector => ${WORKSPACE_DIR}/connector - - go.opentelemetry.io/collector/connector/connectortest => ${WORKSPACE_DIR}/connector/connectortest - - go.opentelemetry.io/collector/connector/xconnector => ${WORKSPACE_DIR}/connector/xconnector - - go.opentelemetry.io/collector/exporter => ${WORKSPACE_DIR}/exporter - - go.opentelemetry.io/collector/exporter/debugexporter => ${WORKSPACE_DIR}/exporter/debugexporter - - go.opentelemetry.io/collector/exporter/xexporter => ${WORKSPACE_DIR}/exporter/xexporter - - go.opentelemetry.io/collector/exporter/exportertest => ${WORKSPACE_DIR}/exporter/exportertest - - go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper => ${WORKSPACE_DIR}/exporter/exporterhelper/xexporterhelper - - go.opentelemetry.io/collector/extension => ${WORKSPACE_DIR}/extension - - go.opentelemetry.io/collector/extension/auth => ${WORKSPACE_DIR}/extension/auth - - go.opentelemetry.io/collector/extension/auth/authtest => ${WORKSPACE_DIR}/extension/auth/authtest - - go.opentelemetry.io/collector/extension/extensioncapabilities => ${WORKSPACE_DIR}/extension/extensioncapabilities - - go.opentelemetry.io/collector/extension/extensiontest => ${WORKSPACE_DIR}/extension/extensiontest - - go.opentelemetry.io/collector/extension/zpagesextension => ${WORKSPACE_DIR}/extension/zpagesextension - - go.opentelemetry.io/collector/extension/xextension => ${WORKSPACE_DIR}/extension/xextension - - go.opentelemetry.io/collector/featuregate => ${WORKSPACE_DIR}/featuregate - - go.opentelemetry.io/collector/internal/memorylimiter => ${WORKSPACE_DIR}/internal/memorylimiter - - go.opentelemetry.io/collector/internal/fanoutconsumer => ${WORKSPACE_DIR}/internal/fanoutconsumer - - go.opentelemetry.io/collector/internal/sharedcomponent => ${WORKSPACE_DIR}/internal/sharedcomponent - - go.opentelemetry.io/collector/otelcol => ${WORKSPACE_DIR}/otelcol - - go.opentelemetry.io/collector/otelcol/otelcoltest => ${WORKSPACE_DIR}/otelcol/otelcoltest - - go.opentelemetry.io/collector/pdata => ${WORKSPACE_DIR}/pdata - - go.opentelemetry.io/collector/pdata/pprofile => ${WORKSPACE_DIR}/pdata/pprofile - - go.opentelemetry.io/collector/pdata/testdata => ${WORKSPACE_DIR}/pdata/testdata - - go.opentelemetry.io/collector/pipeline => ${WORKSPACE_DIR}/pipeline - - go.opentelemetry.io/collector/pipeline/xpipeline => ${WORKSPACE_DIR}/pipeline/xpipeline - - go.opentelemetry.io/collector/processor => ${WORKSPACE_DIR}/processor - - go.opentelemetry.io/collector/processor/processortest => ${WORKSPACE_DIR}/processor/processortest - - go.opentelemetry.io/collector/processor/xprocessor => ${WORKSPACE_DIR}/processor/xprocessor - - go.opentelemetry.io/collector/receiver => ${WORKSPACE_DIR}/receiver - - go.opentelemetry.io/collector/receiver/otlpreceiver => ${WORKSPACE_DIR}/receiver/otlpreceiver - - go.opentelemetry.io/collector/receiver/xreceiver => ${WORKSPACE_DIR}/receiver/xreceiver - - go.opentelemetry.io/collector/receiver/receivertest => ${WORKSPACE_DIR}/receiver/receivertest - - go.opentelemetry.io/collector/scraper => ${WORKSPACE_DIR}/scraper - - go.opentelemetry.io/collector/scraper/scraperhelper => ${WORKSPACE_DIR}/scraper/scraperhelper - - go.opentelemetry.io/collector/semconv => ${WORKSPACE_DIR}/semconv - - go.opentelemetry.io/collector/service => ${WORKSPACE_DIR}/service diff --git a/cmd/builder/test/test.sh b/cmd/builder/test/test.sh index bcedc7433f1..de8c341f1f5 100755 --- a/cmd/builder/test/test.sh +++ b/cmd/builder/test/test.sh @@ -33,7 +33,7 @@ test_build_config() { echo "Starting test '${test}' at $(date)" >> "${out}/test.log" final_build_config=$(basename "${build_config}") - "${WORKSPACE_DIR}/.tools/envsubst" < "$build_config" > "${out}/${final_build_config}" + "${WORKSPACE_DIR}/.tools/envsubst" -o "${out}/${final_build_config}" -i <(cat "$build_config" "$replaces") if ! go run . --config "${out}/${final_build_config}" --output-path "${out}" > "${out}/builder.log" 2>&1; then echo "❌ FAIL ${test}. Failed to compile the test ${test}. Build logs:" cat "${out}/builder.log" @@ -113,6 +113,16 @@ tests="core" base=$(mktemp -d) echo "Running the tests in ${base}" +replaces="$base/replaces" +# Get path of all core modules, in sorted order +core_mods=$(cd ../.. && find . -type f -name "go.mod" -exec dirname {} \; | sort) +echo "replaces:" >> "$replaces" +for mod_path in $core_mods; do + mod=${mod_path#"."} # remove initial dot + echo " - go.opentelemetry.io/collector$mod => \${WORKSPACE_DIR}$mod" >> "$replaces" +done +echo "Wrote replace statements to $replaces" + failed=false for test in $tests