diff --git a/.circleci/Readme.md b/.circleci/Readme.md new file mode 100644 index 0000000..af32be0 --- /dev/null +++ b/.circleci/Readme.md @@ -0,0 +1,31 @@ + + +# CircleCI config files + +This directory contains the configuration for CircleCI continuous integration platform. +The file `config.yml` is the configuration file that is read by CircleCI. This file is +automatically generated by the `config_template.yml` file. + +## Updating the config +For configuration changes meant to be permanent in the Apache repo you should never edit +the `config.yml` file manually. Instead, you should edit the `config_template.yml` file and then +regenerate the `config.yml` by running: + `circleci config process config_template.yml > config.yml` diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..63e9511 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,662 @@ +version: 2 +jobs: + j8_build: + docker: + - image: edimitrova86/jamm-testing-ubuntu2204:latest + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - run: + name: Log Environment Information + command: | + echo '*** id ***' + id + echo '*** cat /proc/cpuinfo ***' + cat /proc/cpuinfo + echo '*** free -m ***' + free -m + echo '*** df -m ***' + df -m + echo '*** ifconfig -a ***' + ifconfig -a + echo '*** uname -a ***' + uname -a + echo '*** mount ***' + mount + echo '*** env ***' + env + echo '*** java ***' + which java + java -version + mvn -version + - run: + name: Clone Jamm Repository (via git) + command: | + git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git ~/jamm + - run: + name: Build Jamm + command: | + export PATH=$JAVA_HOME/bin:$PATH + mkdir .m2 + cd ~/jamm + cp toolchains.example.xml ~/.m2/toolchains.xml + mvn compile + mvn compiler:testCompile + mvn jar:test-jar + no_output_timeout: 15m + - persist_to_workspace: + root: /home/jamm + paths: + - jamm + - .m2 + environment: + - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - LANG: en_US.UTF-8 + - KEEP_TEST_DIR: true + - DEFAULT_DIR: /home/jamm/jamm-test + - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j8_32_bits_tests: + docker: + - image: edimitrova86/jamm-testing-ubuntu2204:latest + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - attach_workspace: + at: /home/jamm + - run: + name: Log Environment Information + command: | + echo '*** id ***' + id + echo '*** cat /proc/cpuinfo ***' + cat /proc/cpuinfo + echo '*** free -m ***' + free -m + echo '*** df -m ***' + df -m + echo '*** ifconfig -a ***' + ifconfig -a + echo '*** uname -a ***' + uname -a + echo '*** mount ***' + mount + echo '*** env ***' + env + echo '*** java ***' + which java + java -version + mvn -version + - run: + name: Run Tests + command: | + set -x + export PATH=$JAVA_HOME/bin:$PATH + time mv ~/jamm /tmp + cd /tmp/jamm + EXECUTION_ID=surefire:test@test-jdk8-32 ./run-tests.sh + no_output_timeout: 30m + - store_test_results: + path: /tmp/jamm/test/output/ + - store_artifacts: + path: /tmp/jamm/test/logs + destination: logs + environment: + - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - LANG: en_US.UTF-8 + - KEEP_TEST_DIR: true + - DEFAULT_DIR: /home/jamm/jamm-test + - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j8_64_bits_tests: + docker: + - image: edimitrova86/jamm-testing-ubuntu2204:latest + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - attach_workspace: + at: /home/jamm + - run: + name: Log Environment Information + command: | + echo '*** id ***' + id + echo '*** cat /proc/cpuinfo ***' + cat /proc/cpuinfo + echo '*** free -m ***' + free -m + echo '*** df -m ***' + df -m + echo '*** ifconfig -a ***' + ifconfig -a + echo '*** uname -a ***' + uname -a + echo '*** mount ***' + mount + echo '*** env ***' + env + echo '*** java ***' + which java + java -version + mvn -version + - run: + name: Run Tests + command: | + set -x + export PATH=$JAVA_HOME/bin:$PATH + time mv ~/jamm /tmp + cd /tmp/jamm + EXECUTION_ID=surefire:test@test-default ./run-tests.sh + no_output_timeout: 30m + - store_test_results: + path: /tmp/jamm/test/output/ + - store_artifacts: + path: /tmp/jamm/test/logs + destination: logs + environment: + - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - LANG: en_US.UTF-8 + - KEEP_TEST_DIR: true + - DEFAULT_DIR: /home/jamm/jamm-test + - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j11_32_bits_tests: + docker: + - image: edimitrova86/jamm-testing-ubuntu2204:latest + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - attach_workspace: + at: /home/jamm + - run: + name: Log Environment Information + command: | + echo '*** id ***' + id + echo '*** cat /proc/cpuinfo ***' + cat /proc/cpuinfo + echo '*** free -m ***' + free -m + echo '*** df -m ***' + df -m + echo '*** ifconfig -a ***' + ifconfig -a + echo '*** uname -a ***' + uname -a + echo '*** mount ***' + mount + echo '*** env ***' + env + echo '*** java ***' + which java + java -version + mvn -version + - run: + name: Run Tests + command: | + set -x + export PATH=$JAVA_HOME/bin:$PATH + time mv ~/jamm /tmp + cd /tmp/jamm + EXECUTION_ID=surefire:test@test-jdk11-32 ./run-tests.sh + no_output_timeout: 30m + - store_test_results: + path: /tmp/jamm/test/output/ + - store_artifacts: + path: /tmp/jamm/test/logs + destination: logs + environment: + - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - LANG: en_US.UTF-8 + - KEEP_TEST_DIR: true + - DEFAULT_DIR: /home/jamm/jamm-test + - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j11_64_bits_tests: + docker: + - image: edimitrova86/jamm-testing-ubuntu2204:latest + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - attach_workspace: + at: /home/jamm + - run: + name: Log Environment Information + command: | + echo '*** id ***' + id + echo '*** cat /proc/cpuinfo ***' + cat /proc/cpuinfo + echo '*** free -m ***' + free -m + echo '*** df -m ***' + df -m + echo '*** ifconfig -a ***' + ifconfig -a + echo '*** uname -a ***' + uname -a + echo '*** mount ***' + mount + echo '*** env ***' + env + echo '*** java ***' + which java + java -version + mvn -version + - run: + name: Run Tests + command: | + set -x + export PATH=$JAVA_HOME/bin:$PATH + time mv ~/jamm /tmp + cd /tmp/jamm + EXECUTION_ID=surefire:test@test-jdk11-64 ./run-tests.sh + no_output_timeout: 30m + - store_test_results: + path: /tmp/jamm/test/output/ + - store_artifacts: + path: /tmp/jamm/test/logs + destination: logs + environment: + - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - LANG: en_US.UTF-8 + - KEEP_TEST_DIR: true + - DEFAULT_DIR: /home/jamm/jamm-test + - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j17_32_bits_tests: + docker: + - image: edimitrova86/jamm-testing-ubuntu2204:latest + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - attach_workspace: + at: /home/jamm + - run: + name: Log Environment Information + command: | + echo '*** id ***' + id + echo '*** cat /proc/cpuinfo ***' + cat /proc/cpuinfo + echo '*** free -m ***' + free -m + echo '*** df -m ***' + df -m + echo '*** ifconfig -a ***' + ifconfig -a + echo '*** uname -a ***' + uname -a + echo '*** mount ***' + mount + echo '*** env ***' + env + echo '*** java ***' + which java + java -version + mvn -version + - run: + name: Run Tests + command: | + set -x + export PATH=$JAVA_HOME/bin:$PATH + time mv ~/jamm /tmp + cd /tmp/jamm + EXECUTION_ID=surefire:test@test-jdk17-32 ./run-tests.sh + no_output_timeout: 30m + - store_test_results: + path: /tmp/jamm/test/output/ + - store_artifacts: + path: /tmp/jamm/test/logs + destination: logs + environment: + - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - LANG: en_US.UTF-8 + - KEEP_TEST_DIR: true + - DEFAULT_DIR: /home/jamm/jamm-test + - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + j17_64_bits_tests: + docker: + - image: edimitrova86/jamm-testing-ubuntu2204:latest + resource_class: medium + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + parallelism: 1 + steps: + - attach_workspace: + at: /home/jamm + - run: + name: Log Environment Information + command: | + echo '*** id ***' + id + echo '*** cat /proc/cpuinfo ***' + cat /proc/cpuinfo + echo '*** free -m ***' + free -m + echo '*** df -m ***' + df -m + echo '*** ifconfig -a ***' + ifconfig -a + echo '*** uname -a ***' + uname -a + echo '*** mount ***' + mount + echo '*** env ***' + env + echo '*** java ***' + which java + java -version + mvn -version + - run: + name: Run Tests + command: | + set -x + export PATH=$JAVA_HOME/bin:$PATH + time mv ~/jamm /tmp + cd /tmp/jamm + EXECUTION_ID=surefire:test@test-jdk17-64 ./run-tests.sh + no_output_timeout: 30m + - store_test_results: + path: /tmp/jamm/test/output/ + - store_artifacts: + path: /tmp/jamm/test/logs + destination: logs + environment: + - JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + - JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - LANG: en_US.UTF-8 + - KEEP_TEST_DIR: true + - DEFAULT_DIR: /home/jamm/jamm-test + - JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + - JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 +workflows: + version: 2 + jamm_tests: + jobs: + - start_j8_build: + type: approval + - j8_build: + requires: + - start_j8_build + - start_j8_32_bits_tests: + type: approval + - j8_32_bits_tests: + requires: + - start_j8_32_bits_tests + - j8_build + - start_j8_64_bits_tests: + type: approval + - j8_64_bits_tests: + requires: + - start_j8_64_bits_tests + - j8_build + - start_j11_32_bits_tests: + type: approval + - j11_32_bits_tests: + requires: + - start_j11_32_bits_tests + - j8_build + - start_j11_64_bits_tests: + type: approval + - j11_64_bits_tests: + requires: + - start_j11_64_bits_tests + - j8_build + - start_j17_32_bits_tests: + type: approval + - j17_32_bits_tests: + requires: + - start_j17_32_bits_tests + - j8_build + - start_j17_64_bits_tests: + type: approval + - j17_64_bits_tests: + requires: + - start_j17_64_bits_tests + - j8_build + +# Original config.yml file: +# version: 2.1 +# +# default_env_vars: &default_env_vars +# JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 +# JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 +# LANG: en_US.UTF-8 +# KEEP_TEST_DIR: true +# DEFAULT_DIR: /home/jamm/jamm-test +# +# j8_64bits_small_executor: &j8_64bits_small_executor +# executor: +# name: java8-64bits-executor +# exec_resource_class: medium +# parallelism: 1 +# +# test_jobs: &test_jobs +# jobs: +# - start_j8_build: +# type: approval +# - j8_build: +# requires: +# - start_j8_build +# # Java 8 tests +# - start_j8_32_bits_tests: +# type: approval +# - j8_32_bits_tests: +# requires: +# - start_j8_32_bits_tests +# - j8_build +# - start_j8_64_bits_tests: +# type: approval +# - j8_64_bits_tests: +# requires: +# - start_j8_64_bits_tests +# - j8_build +# # Java 11 tests +# - start_j11_32_bits_tests: +# type: approval +# - j11_32_bits_tests: +# requires: +# - start_j11_32_bits_tests +# - j8_build +# - start_j11_64_bits_tests: +# type: approval +# - j11_64_bits_tests: +# requires: +# - start_j11_64_bits_tests +# - j8_build +# # Java 17 tests +# - start_j17_32_bits_tests: +# type: approval +# - j17_32_bits_tests: +# requires: +# - start_j17_32_bits_tests +# - j8_build +# - start_j17_64_bits_tests: +# type: approval +# - j17_64_bits_tests: +# requires: +# - start_j17_64_bits_tests +# - j8_build +# +# workflows: +# version: 2 +# jamm_tests: *test_jobs +# +# executors: +# java8-64bits-executor: +# parameters: +# exec_resource_class: +# type: string +# default: medium +# docker: +# - image: edimitrova86/jamm-testing-ubuntu2204:latest +# resource_class: << parameters.exec_resource_class >> +# working_directory: ~/ +# shell: /bin/bash -eo pipefail -l +# environment: +# <<: *default_env_vars +# JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 +# JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 +# +# build_common: &build_common +# parallelism: 1 # This job doesn't benefit from parallelism +# steps: +# - log_environment +# - clone_jamm +# - build_jamm +# - persist_to_workspace: +# root: /home/jamm +# paths: +# - jamm +# - .m2 +# +# jobs: +# j8_build: +# executor: java8-64bits-executor +# <<: *build_common +# +# j8_32_bits_tests: +# <<: *j8_64bits_small_executor +# steps: +# - attach_workspace: +# at: /home/jamm +# - log_environment +# - run_tests: +# execution_id: surefire:test@test-jdk8-32 +# +# j8_64_bits_tests: +# <<: *j8_64bits_small_executor +# steps: +# - attach_workspace: +# at: /home/jamm +# - log_environment +# - run_tests: +# execution_id: surefire:test@test-default +# +# j11_64_bits_tests: +# <<: *j8_64bits_small_executor +# steps: +# - attach_workspace: +# at: /home/jamm +# - log_environment +# - run_tests: +# execution_id: surefire:test@test-jdk11-64 +# +# j11_32_bits_tests: +# <<: *j8_64bits_small_executor +# steps: +# - attach_workspace: +# at: /home/jamm +# - log_environment +# - run_tests: +# execution_id: surefire:test@test-jdk11-32 +# +# j17_64_bits_tests: +# <<: *j8_64bits_small_executor +# steps: +# - attach_workspace: +# at: /home/jamm +# - log_environment +# - run_tests: +# execution_id: surefire:test@test-jdk17-64 +# +# j17_32_bits_tests: +# <<: *j8_64bits_small_executor +# steps: +# - attach_workspace: +# at: /home/jamm +# - log_environment +# - run_tests: +# execution_id: surefire:test@test-jdk17-32 +# +# commands: +# log_environment: +# steps: +# - run: +# name: Log Environment Information +# command: | +# echo '*** id ***' +# id +# echo '*** cat /proc/cpuinfo ***' +# cat /proc/cpuinfo +# echo '*** free -m ***' +# free -m +# echo '*** df -m ***' +# df -m +# echo '*** ifconfig -a ***' +# ifconfig -a +# echo '*** uname -a ***' +# uname -a +# echo '*** mount ***' +# mount +# echo '*** env ***' +# env +# echo '*** java ***' +# which java +# java -version +# mvn -version +# +# clone_jamm: +# steps: +# - run: +# name: Clone Jamm Repository (via git) +# command: | +# git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git ~/jamm +# +# build_jamm: +# steps: +# - run: +# name: Build Jamm +# command: | +# export PATH=$JAVA_HOME/bin:$PATH +# mkdir .m2 +# cd ~/jamm +# cp toolchains.example.xml ~/.m2/toolchains.xml +# mvn compile +# mvn compiler:testCompile +# mvn jar:test-jar +# no_output_timeout: 15m +# +# run_tests: +# parameters: +# execution_id: +# type: string +# default: \"\" +# no_output_timeout: +# type: string +# default: 30m +# steps: +# - run: +# name: Run Tests +# command: | +# set -x +# export PATH=$JAVA_HOME/bin:$PATH +# time mv ~/jamm /tmp +# cd /tmp/jamm +# EXECUTION_ID=<> ./run-tests.sh +# no_output_timeout: <> +# - store_test_results: +# path: /tmp/jamm/test/output/ +# - store_artifacts: +# path: /tmp/jamm/test/logs +# destination: logs \ No newline at end of file diff --git a/.circleci/config_template.yml b/.circleci/config_template.yml new file mode 100644 index 0000000..cb824db --- /dev/null +++ b/.circleci/config_template.yml @@ -0,0 +1,224 @@ +version: 2.1 + +default_env_vars: &default_env_vars + JAVA11_HOME: /usr/lib/jvm/java-11-openjdk-amd64 + JAVA8_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + LANG: en_US.UTF-8 + KEEP_TEST_DIR: true + DEFAULT_DIR: /home/jamm/jamm-test + +j8_64bits_small_executor: &j8_64bits_small_executor + executor: + name: java8-64bits-executor + exec_resource_class: medium + parallelism: 1 + +test_jobs: &test_jobs + jobs: + - start_j8_build: + type: approval + - j8_build: + requires: + - start_j8_build + # Java 8 tests + - start_j8_32_bits_tests: + type: approval + - j8_32_bits_tests: + requires: + - start_j8_32_bits_tests + - j8_build + - start_j8_64_bits_tests: + type: approval + - j8_64_bits_tests: + requires: + - start_j8_64_bits_tests + - j8_build + # Java 11 tests + - start_j11_32_bits_tests: + type: approval + - j11_32_bits_tests: + requires: + - start_j11_32_bits_tests + - j8_build + - start_j11_64_bits_tests: + type: approval + - j11_64_bits_tests: + requires: + - start_j11_64_bits_tests + - j8_build + # Java 17 tests + - start_j17_32_bits_tests: + type: approval + - j17_32_bits_tests: + requires: + - start_j17_32_bits_tests + - j8_build + - start_j17_64_bits_tests: + type: approval + - j17_64_bits_tests: + requires: + - start_j17_64_bits_tests + - j8_build + +workflows: + version: 2 + jamm_tests: *test_jobs + +executors: + java8-64bits-executor: + parameters: + exec_resource_class: + type: string + default: medium + docker: + - image: edimitrova86/jamm-testing-ubuntu2204:latest + resource_class: << parameters.exec_resource_class >> + working_directory: ~/ + shell: /bin/bash -eo pipefail -l + environment: + <<: *default_env_vars + JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + JDK_HOME: /usr/lib/jvm/java-8-openjdk-amd64 + +build_common: &build_common + parallelism: 1 # This job doesn't benefit from parallelism + steps: + - log_environment + - clone_jamm + - build_jamm + - persist_to_workspace: + root: /home/jamm + paths: + - jamm + - .m2 + +jobs: + j8_build: + executor: java8-64bits-executor + <<: *build_common + + j8_32_bits_tests: + <<: *j8_64bits_small_executor + steps: + - attach_workspace: + at: /home/jamm + - log_environment + - run_tests: + execution_id: surefire:test@test-jdk8-32 + + j8_64_bits_tests: + <<: *j8_64bits_small_executor + steps: + - attach_workspace: + at: /home/jamm + - log_environment + - run_tests: + execution_id: surefire:test@test-default + + j11_64_bits_tests: + <<: *j8_64bits_small_executor + steps: + - attach_workspace: + at: /home/jamm + - log_environment + - run_tests: + execution_id: surefire:test@test-jdk11-64 + + j11_32_bits_tests: + <<: *j8_64bits_small_executor + steps: + - attach_workspace: + at: /home/jamm + - log_environment + - run_tests: + execution_id: surefire:test@test-jdk11-32 + + j17_64_bits_tests: + <<: *j8_64bits_small_executor + steps: + - attach_workspace: + at: /home/jamm + - log_environment + - run_tests: + execution_id: surefire:test@test-jdk17-64 + + j17_32_bits_tests: + <<: *j8_64bits_small_executor + steps: + - attach_workspace: + at: /home/jamm + - log_environment + - run_tests: + execution_id: surefire:test@test-jdk17-32 + +commands: + log_environment: + steps: + - run: + name: Log Environment Information + command: | + echo '*** id ***' + id + echo '*** cat /proc/cpuinfo ***' + cat /proc/cpuinfo + echo '*** free -m ***' + free -m + echo '*** df -m ***' + df -m + echo '*** ifconfig -a ***' + ifconfig -a + echo '*** uname -a ***' + uname -a + echo '*** mount ***' + mount + echo '*** env ***' + env + echo '*** java ***' + which java + java -version + mvn -version + + clone_jamm: + steps: + - run: + name: Clone Jamm Repository (via git) + command: | + git clone --single-branch --depth 1 --branch $CIRCLE_BRANCH https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git ~/jamm + + build_jamm: + steps: + - run: + name: Build Jamm + command: | + export PATH=$JAVA_HOME/bin:$PATH + mkdir .m2 + cd ~/jamm + cp toolchains.example.xml ~/.m2/toolchains.xml + mvn compile + mvn compiler:testCompile + mvn jar:test-jar + no_output_timeout: 15m + + run_tests: + parameters: + execution_id: + type: string + default: "" + no_output_timeout: + type: string + default: 30m + steps: + - run: + name: Run Tests + command: | + set -x + export PATH=$JAVA_HOME/bin:$PATH + time mv ~/jamm /tmp + cd /tmp/jamm + EXECUTION_ID=<> ./run-tests.sh + no_output_timeout: <> + - store_test_results: + path: /tmp/jamm/test/output/ + - store_artifacts: + path: /tmp/jamm/test/logs + destination: logs diff --git a/README.md b/README.md index 8a69628..510516c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ should be put in your `${user.home}/.m2` directory. When the maven-toolchains-pl file, reads it and looks for a toolchain matching the toolchains requirements configured in the plugin. Jamm repo contains a `toolchains.example.xml` which you can use as a baseline for your own `toolchains.xml`. You need it to be able to run the tests. Copy `toolchains.example.xml` to `${user.home}/.m2`, rename the file to `toolchains.xml`. -In `toolchains.xml`, check to update your vendor and jdkHome for JDK8, JDK11 and JDK17 which you have installed on your machine. +In `toolchains.xml`, check to update your vendor and jdkHome for JDK8, JDK11 and JDK17 (32 and 64 bit) which you have installed on your machine. # Running Tests @@ -30,9 +30,9 @@ mvn test -DjvmArgs="-Xmx64g" mvn test -DjvmArgs="-Xmx64g -XX:ObjectAlignmentInBytes=16 -XX:-UseCompressedClassPointers" ``` -`mvn test` runs all tests with JDK8, JDK11, and then with JDK17 +`mvn test` runs all tests with JDK8, JDK11, and then with JDK17 (both 32 and 64 bit) To run the tests with only one particular JDK version run: -* for JDK8: +* for JDK8 (64 bit): ``` mvn surefire:test@test-default ``` @@ -40,13 +40,25 @@ or ``` mvn surefire:test ``` -* for JDK11: +* for JDK8 (32 bit) ``` -mvn surefire:test@test-jdk11 +mvn surefire:test@test-jdk8-32 ``` -* for JDK17: +* for JDK11 (64 bit): ``` -mvn surefire:test@test-jdk17 +mvn surefire:test@test-jdk11-64 +``` +* for JDK11 (32 bit): +``` +mvn surefire:test@test-jdk11-32 +``` +* for JDK17 (64 bit): +``` +mvn surefire:test@test-jdk17-64 +``` +* for JDK17 (32 bit): +``` +mvn surefire:test@test-jdk17-32 ``` # Use diff --git a/docker/Readme.md b/docker/Readme.md new file mode 100644 index 0000000..c57f26d --- /dev/null +++ b/docker/Readme.md @@ -0,0 +1,34 @@ + + +# Docker CI Testing + +Docker file in this directory is used to build image used by CircleCI. + +## Building and Publishing Images + +Build image from the parent directory using the following command (currently building only amd and Ekaterina +publish it as it is in her dockerhub repo for initial test purposes): + +`docker buildx build --platform linux/amd64 -t edimitrova86/jamm-testing-ubuntu2204:$(date +"%Y%m%d") -t edimitrova86/jamm-testing-ubuntu2204:latest -f ubuntu2204.docker --push .` + +Please make sure to always tag also by date, so we can go back to that version in case anything breaks after the next update! + +We are using Docker Hub for storing published images. diff --git a/docker/ubuntu2204.docker b/docker/ubuntu2204.docker new file mode 100644 index 0000000..06cbe31 --- /dev/null +++ b/docker/ubuntu2204.docker @@ -0,0 +1,91 @@ + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ubuntu:22.04 +# Maintainer: TBD +MAINTAINER Apache Cassandra + +# configure apt to retry downloads +RUN echo 'APT::Acquire::Retries "99";' > /etc/apt/apt.conf.d/80-retries +RUN echo 'Acquire::http::Timeout "60";' > /etc/apt/apt.conf.d/80proxy.conf +RUN echo 'Acquire::ftp::Timeout "60";' >> /etc/apt/apt.conf.d/80proxy.conf + +RUN export DEBIAN_FRONTEND=noninteractive && \ + apt-get update && \ + apt-get install -y --no-install-recommends software-properties-common apt-utils vim && \ + apt-get install -y lsof && \ + apt-get install -y gpg-agent + +RUN export DEBIAN_FRONTEND=noninteractive && \ + apt-get update && \ + apt-get install -y curl git-core \ + net-tools libev4 libev-dev wget gcc libssl-dev libxml2 libxslt1-dev + +# install dumb-init as minimal init system +RUN export DEBIAN_FRONTEND=noninteractive && \ + apt-get update && \ + apt-get install -y dumb-init + +# generate locales for the standard en_US.UTF8 value we use for testing +RUN export DEBIAN_FRONTEND=noninteractive && \ + apt-get update && \ + apt-get install -y locales && \ + locale-gen en_US.UTF-8 + +# openjdk +RUN export DEBIAN_FRONTEND=noninteractive && \ + apt-get update && \ + dpkg --add-architecture i386 && \ + apt-get update && \ + apt-get install -y --no-install-recommends openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk openjdk-11-jdk:i386 openjdk-17-jdk:i386 openjdk-8-jdk:i386 +# we hit this bug - https://bugs.launched.net/ubutu/+source/openjdk-8/+bug/1890592 so we run the mention workaround +RUN export DEBIAN_FRONTEND=noninteractive && \ + apt -o=Dpkg::Options::="--force-overwrite" --fix-broken install + + +# make Java 8 the default executable (we use to run all tests against Java 8) +RUN update-java-alternatives --set java-1.8.0-openjdk-$(dpkg --print-architecture) + +# setup our own user +RUN export DEBIAN_FRONTEND=noninteractive && \ + apt-get install sudo && \ + adduser --disabled-password --gecos "" jamm && \ + echo "jamm ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/jamm && \ + chmod 0440 /etc/sudoers.d/jamm + +# fix up permissions on the jamm home dir +RUN chown -R jamm:jamm /home/jamm + +# switch to the jamm user... we are all done running things as root +USER jamm +ENV HOME /home/jamm +WORKDIR /home/jamm + +# add environment variables for Ant and Java and add them to the PATH +RUN echo 'export ANT_HOME=/usr/share/ant' >> /home/jamm/.bashrc && \ + echo 'export JAVA8_HOME=/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)' >> /home/jamm/.bashrc && \ + echo 'export JAVA11_HOME=/usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture)' >> /home/jamm/.bashrc && \ + echo 'export JAVA17_HOME=/usr/lib/jvm/java-17-openjdk-$(dpkg --print-architecture)' >> /home/jamm/.bashrc && \ + echo 'export JAVA_HOME=$JAVA8_HOME' >> /home/jamm/.bashrc + +# add maven +RUN export DEBIAN_FRONTEND=noninteractive && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends maven + +# below is leftover from the Cassandra test image used as a template, not convinced we will need this for jamm +# mark "/tmp" as a volume so it will get mounted as an ext4 mount and not +# the stupid aufs/CoW stuff that the actual docker container mounts will have. +# We've been seeing 3+ minute hangs when calling sync on an aufs backed mount +# so it greatly makes tests flaky as things can hang basically anywhere +VOLUME ["/tmp"] diff --git a/pom.xml b/pom.xml index 49d5659..53f1e18 100644 --- a/pom.xml +++ b/pom.xml @@ -180,24 +180,62 @@ - test-jdk11 + test-jdk8-32 + + test + + + + 1.8 + Private Build + + + + + test-jdk11-64 test 11 + Oracle Corporation + + + + + test-jdk11-32 + + test + + + + 11 + Private Build + + + + + test-jdk17-64 + + test + + + + 17 + Oracle Corporation - test-jdk17 + test-jdk17-32 test 17 + Private Build diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 0000000..bfd1fcd --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# E.g. run the following in your jamm directory to kick off testing (for more info on EXECUTION_ID check the README toolchains section) +# sudo EXECUTION_ID=test ./run-tests.sh +# +# Prerequisites +[ "x$EXECUTION_ID" != "x" ] || { echo "Variable EXECUTION_ID must be defined"; exit 1; } + +mvn "${EXECUTION_ID}" +mvn "${EXECUTION_ID}" -DjvmArgs="-Xmx16G -XX:ObjectAlignmentInBytes=16" + +case "$EXECUTION_ID" in + surefire:test@test-default|surefire:test@test-jdk11-64|surefire:test@test-jdk17-64) + mvn "${EXECUTION_ID}" -DjvmArgs="-XX:+UseCompressedClassPointers -XX:+UseCompressedOops" + mvn "${EXECUTION_ID}" -DjvmArgs="-XX:-UseCompressedClassPointers -XX:-UseCompressedOops" + mvn "${EXECUTION_ID}" -DjvmArgs="-XX:+UseCompressedClassPointers -XX:-UseCompressedOops" + ;; + *) + # do nothing + ;; +esac + + +case "$EXECUTION_ID" in + surefire:test@test-jdk17-32|surefire:test@test-jdk17-64) + # mvn "${EXECUTION_ID}" -DjvmArgs="-XX:-UseEmptySlotsInSupers" This test currently fails, though it is commented out. Please check the README for more info + mvn "${EXECUTION_ID}" -DjvmArgs="-XX:+UseEmptySlotsInSupers" + ;; + *) + # do nothing + ;; +esac + +mvn "${EXECUTION_ID}" -DjvmArgs="-XX:+EnableContended -XX:+RestrictContended" +mvn "${EXECUTION_ID}" -DjvmArgs="-XX:+EnableContended -XX:-RestrictContended" +case "$EXECUTION_ID" in + surefire:test@test-default|surefire:test@test-jdk8-32|surefire:test@test-jdk11-64|surefire:test@test-jdk11-32) + mvn "${EXECUTION_ID}" -DjvmArgs="-XX:-EnableContended -XX:+RestrictContended" + mvn "${EXECUTION_ID}" -DjvmArgs="-XX:+EnableContended -XX:+RestrictContended -XX:ContendedPaddingWidth=64" + ;; + *) + # do nothing + ;; +esac diff --git a/test/org/github/jamm/GuessTest.java b/test/org/github/jamm/GuessTest.java index 5aaf2a0..6917488 100644 --- a/test/org/github/jamm/GuessTest.java +++ b/test/org/github/jamm/GuessTest.java @@ -372,7 +372,7 @@ private Decl(ClassDecl[] classdecls, Def def) { // compile the provided defs by declaring them in source files and calling javac private static List compile(List defs) throws IOException, ExecutionException, InterruptedException { final List args = new ArrayList(); - args.addAll(Arrays.asList("javac", "-d", tempDir.getAbsolutePath())); + args.addAll(Arrays.asList("javac", "-d", tempDir.getAbsolutePath(), "-source", "1.8", "-target", "1.8")); final List decls = new ArrayList(); for (Def def : defs) decls.add(def.declare()); diff --git a/toolchains.example.xml b/toolchains.example.xml index 263b73e..1834bd3 100644 --- a/toolchains.example.xml +++ b/toolchains.example.xml @@ -8,7 +8,17 @@ Oracle Corporation - /Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home + /usr/lib/jvm/java-8-openjdk-amd64 + + + + jdk + + 1.8 + Private Build + + + /usr/lib/jvm/java-8-openjdk-i386 @@ -18,7 +28,17 @@ Oracle Corporation - /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home + /usr/lib/jvm/java-11-openjdk-amd64 + + + + jdk + + 11 + Private Build + + + /usr/lib/jvm/java-11-openjdk-i386 @@ -28,7 +48,17 @@ Oracle Corporation - /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home + /usr/lib/jvm/java-17-openjdk-amd64 + + + + jdk + + 17 + Private Build + + + /usr/lib/jvm/java-17-openjdk-i386