@@ -365,6 +365,21 @@ jobs:
365365
366366 - display_memory_usage
367367
368+ spotless:
369+ <<: *defaults
370+ resource_class: medium+
371+
372+ steps:
373+ - setup_code
374+
375+ - run:
376+ name: Run spotless
377+ command: >-
378+ JAVA_HOME=$JAVA_11_HOME
379+ ./gradlew spotlessCheck
380+ << pipeline.parameters.gradle_flags >>
381+ --max-workers=8
382+
368383 check:
369384 <<: *defaults
370385
@@ -690,6 +705,117 @@ jobs:
690705 - DD_BIND_HOST=0.0.0.0
691706 - DD_API_KEY=invalid_key_but_this_is_fine
692707
708+ test_published_artifacts:
709+ <<: *defaults
710+ resource_class: medium
711+ docker:
712+ - image: << pipeline.parameters.docker_image >>:{{ docker_image_prefix }}7
713+
714+ steps:
715+ - setup_code
716+ - restore_dependency_cache:
717+ cacheType: lib
718+ - restore_build_cache:
719+ cacheType: lib
720+
721+ - run:
722+ name: Publish Artifacts Locally
723+ command: |
724+ mvn_local_repo=$(./mvnw help:evaluate -Dexpression=settings.localRepository -q -DforceStdout)
725+ rm -rf "${mvn_local_repo}/com/datadoghq"
726+ export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
727+ ./gradlew publishToMavenLocal << pipeline.parameters.gradle_flags >> --max-workers=3
728+
729+ - run:
730+ name: Test Published Artifacts
731+ command: |
732+ cd test-published-dependencies
733+ export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx512M -Xms512M -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
734+ ./gradlew check --info --max-workers=3
735+
736+ - run:
737+ name: Collect Reports
738+ when: on_fail
739+ command: .circleci/collect_reports.sh
740+
741+ - store_artifacts:
742+ path: ./reports
743+
744+ - display_memory_usage
745+ muzzle-dep-report:
746+ <<: *defaults
747+ resource_class: medium
748+ steps:
749+ - setup_code
750+ - skip_unless_matching_files_changed:
751+ pattern: " dd-java-agent/instrumentation"
752+ - restore_dependency_cache:
753+ cacheType: inst
754+ - restore_build_cache:
755+ cacheType: inst
756+ - run:
757+ name: Generate muzzle dep report
758+ command: >-
759+ SKIP_BUILDSCAN="true"
760+ GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
761+ ./gradlew generateMuzzleReport muzzleInstrumentationReport
762+ - run:
763+ name: Collect Reports
764+ command: .circleci/collect_muzzle_deps.sh
765+ - store_artifacts:
766+ path: ./reports
767+
768+ muzzle:
769+ <<: *defaults
770+ resource_class: medium+
771+ parallelism: 4
772+ steps:
773+ - setup_code
774+
775+ - skip_unless_matching_files_changed:
776+ pattern: " dd-java-agent/instrumentation"
777+
778+ # We are not running with a separate cache of all muzzle artifacts here because it gets very big and
779+ # ends up taking more time restoring /saving than the actual increase in time it takes just
780+ # downloading the artifacts each time.
781+ #
782+ # Let ' s at least restore the build cache to have something to start from.
783+ - restore_dependency_cache:
784+ cacheType: inst
785+ - restore_build_cache:
786+ cacheType: inst
787+
788+ - run:
789+ name: Gather muzzle tasks
790+ command: >-
791+ SKIP_BUILDSCAN="true"
792+ GRADLE_OPTS="-Dorg.gradle.jvmargs=' -Xmx2G -Xms2G -XX:ErrorFile =/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath =/tmp ' "
793+ ./gradlew writeMuzzleTasksToFile
794+ << pipeline.parameters.gradle_flags >>
795+ --max-workers=3
796+
797+ - run:
798+ name: Verify Muzzle
799+ command: >-
800+ SKIP_BUILDSCAN="true"
801+ GRADLE_OPTS="-Dorg.gradle.jvmargs=' -Xmx3G -Xms2G -XX:ErrorFile =/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath =/tmp ' "
802+ ./gradlew `circleci tests split --split-by=timings workspace/build/muzzleTasks | xargs`
803+ << pipeline.parameters.gradle_flags >>
804+ --max-workers=4
805+
806+ - run:
807+ name: Collect Reports
808+ when: on_fail
809+ command: .circleci/collect_reports.sh
810+
811+ - store_artifacts:
812+ path: ./reports
813+
814+ - store_test_results:
815+ path: workspace/build/muzzle-test-results
816+
817+ - display_memory_usage
818+
693819 system-tests:
694820 machine:
695821 image: ubuntu-2404:current
@@ -943,6 +1069,7 @@ build_test_jobs: &build_test_jobs
9431069 name: build_profiling
9441070 gradleTarget: :profilingTest
9451071 cacheType: profiling
1072+ - spotless
9461073
9471074 - fan_in:
9481075 requires:
@@ -951,6 +1078,7 @@ build_test_jobs: &build_test_jobs
9511078 - build_inst
9521079 - build_smoke
9531080 - build_profiling
1081+ - spotless
9541082 name: ok_to_test
9551083 stage: ok_to_test
9561084
@@ -1299,6 +1427,24 @@ build_test_jobs: &build_test_jobs
12991427 cacheType: base
13001428 testJvm: "8"
13011429
1430+ - test_published_artifacts:
1431+ requires:
1432+ - ok_to_test
1433+
1434+ - muzzle:
1435+ requires:
1436+ - ok_to_test
1437+ filters:
1438+ branches:
1439+ ignore:
1440+ - master
1441+ - project/*
1442+ - release/*
1443+
1444+ - muzzle-dep-report:
1445+ requires:
1446+ - ok_to_test
1447+
13021448 - system-tests:
13031449 requires:
13041450 - ok_to_test
@@ -1319,6 +1465,7 @@ build_test_jobs: &build_test_jobs
13191465
13201466 - fan_in:
13211467 requires:
1468+ - test_published_artifacts
13221469{% for jdk in all_jdks %}
13231470 - "test_{{ jdk }}_profiling"
13241471{% endfor %}
@@ -1327,6 +1474,7 @@ build_test_jobs: &build_test_jobs
13271474
13281475 - fan_in:
13291476 requires:
1477+ - test_published_artifacts
13301478{% for jdk in all_jdks %}
13311479 - "test_{{ jdk }}_debugger"
13321480{% endfor %}
@@ -1338,11 +1486,13 @@ build_test_jobs: &build_test_jobs
13381486 - fan_in:
13391487 requires:
13401488 - check
1489+ - test_published_artifacts
13411490 - agent_integration_tests
13421491{% for jdk in all_jdks %}
13431492 - "test_{{ jdk }}"
13441493{% endfor %}
13451494 - test_inst_latest
1495+ - muzzle
13461496 - profiling
13471497 - debugger
13481498 - system-tests
0 commit comments