Skip to content

Commit

Permalink
Merge pull request #26 from Addepar/scott/junit5-support
Browse files Browse the repository at this point in the history
[buck] enable junit5
  • Loading branch information
scottlee14 authored Nov 13, 2023
2 parents 79f00e3 + d9d02dc commit 0add0af
Show file tree
Hide file tree
Showing 34 changed files with 1,277 additions and 254 deletions.
13 changes: 13 additions & 0 deletions .idea/libraries/apiguardian_api.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/junit5_jupiter_api.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/junit5_platform_commons.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/junit5_platform_engine.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/junit5_platform_launcher.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,41 @@ Buck tries to move fast with respect to its internals. However, for user facing
- For larger features, a change eventually is put in place that sets the default to the new behavior. e.g. when Skylark becomes the default build file parser.
- When the removal date is reached, a change is submitted to remove the feature. At this point, the configuration value will still parse, but will not be used by Buck internally.

Updating the Buck executable in AMP
Developing with the Buck executable in AMP
-----------------------------------

To update `buck.pex` from AMP, run the following in this repo:
To build and use a developmental `buck.pex` in AMP temporarily, run the following in this repo:

ant
./bin/buck build --config java.target_level=11 --config java.source_level=11 --config python.interpreter=python2 --config python.pex_flags='' buck --show-output
cp ./buck-out/gen/<hash>/programs/buck.pex <location-of-AMP-directory>
touch <location-of-AMP-directory>/.ignore-buck-version

Note: `<hash>` is an 8 letter SHA prefix that will depend on which buck commit you're on.
Note: `<hash>` is an 8 letter SHA prefix that will depend on which buck commit you're on. `.ignore-buck-version` is important since without that file, AMP will try to download the version of buck specified in `.buckversion_` instead of using the one you just copied into AMP.

If ant fails with compilation errors on the latest release, try running

ant clean all

Releasing a new version of Buck in AMP
-----------------------------------

Once you're satisfied with a new version of Buck, you can release it to AMP by following these steps:

##### 1. Merge the new release into github.

Raise a PR against the branch `v2022.05.05.01` in https://github.com/Addepar/buck. Get it approved and merged.

##### 2. Create a new release

Go to https://github.com/Addepar/buck/releases and draft a new release, incrementing the version by 1, e.g. v7 to v8.
Make sure to compute the buck.pex SHA1 hash by running `shasum buck.pex` in this repo and make a note of this hash in the release notes.
Also include a link to the PR created in step 1 above.

##### 2. Update the version and buck SHA1 hash in AMP

Raise a PR in AMP updating the buck version and SHA1 hash in `buck.sh` in the AMP repo.
See [this PR](https://github.com/Addepar/AMP/pull/68478/files#diff-dcd8a834dc1ea51b6d597c2247ada269b6e35bdd254a2907925d703d506f1872) for an example.

License
-------
Expand Down
10 changes: 9 additions & 1 deletion buck.iml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<excludeFolder url="file://$MODULE_DIR$/test/com/facebook/buck/util/zip/collect/testdata" />
<excludeFolder url="file://$MODULE_DIR$/test/com/facebook/buck/zip/testdata" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="jdk" jdkName="11" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="asm" level="project" />
<orderEntry type="library" name="buck-lib" level="project" />
Expand Down Expand Up @@ -159,5 +159,13 @@
<orderEntry type="library" name="kotlinx-metadata" level="project" />
<orderEntry type="library" name="jackson-module-kotlin-2.9.9" level="project" />
<orderEntry type="library" name="log4j2" level="project" />
<orderEntry type="library" name="junit5-jupiter-api" level="project" />
<orderEntry type="library" name="junit5-platform-engine" level="project" />
<orderEntry type="library" name="junit5-platform-launcher" level="project" />
<orderEntry type="library" name="junit5-jupiter-api" level="project" />
<orderEntry type="library" name="junit5-platform-engine" level="project" />
<orderEntry type="library" name="junit5-platform-launcher" level="project" />
<orderEntry type="library" name="junit5-platform-commons" level="project" />
<orderEntry type="library" name="apiguardian-api" level="project" />
</component>
</module>
10 changes: 10 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,17 @@

<fileset dir="${third-party.dir}/java" id="testrunner.jars">
<include name="android/ddmlib-25.3.0.jar" />
<include name="apiguardian-api/apiguardian-api-1.1.2.jar" />
<include name="guava/guava-20.0.jar" />
<include name="guava/guava-23.3-jre.jar" />
<include name="guice/guice-3.0.jar" />
<include name="jsr/javax.inject-1.jar" />
<include name="jsr/jsr305.jar" />
<include name="junit/junit-4.12.jar" />
<include name="junit5-jupiter-api/junit-jupiter-api-5.10.1.jar" />
<include name="junit5-platform-commons/junit-platform-commons-1.10.1.jar" />
<include name="junit5-platform-engine/junit-platform-engine-1.10.1.jar" />
<include name="junit5-platform-launcher/junit-platform-launcher-1.10.1.jar" />
<include name="testng/testng-6.8.jar" />
</fileset>

Expand Down Expand Up @@ -1244,7 +1249,12 @@
<path id="javadoc.classpath">
<path refid="classpath" />
<!-- Buck test runner has references to JUnit and TestNG. -->
<pathelement location="${third-party.dir}/java/apiguardian-api/apiguardian-api-1.1.2.jar" />
<pathelement location="${third-party.dir}/java/junit/junit-4.12.jar" />
<pathelement location="${third-party.dir}/java/junit5-jupiter-api/junit-jupiter-api-5.10.1.jar" />
<pathelement location="${third-party.dir}/java/junit5-platform-commons/junit-platform-commons-1.10.1.jar" />
<pathelement location="${third-party.dir}/java/junit5-platform-engine/junit-platform-engine-1.10.1.jar" />
<pathelement location="${third-party.dir}/java/junit5-platform-launcher/junit-platform-launcher-1.10.1.jar" />
<pathelement location="${third-party.dir}/java/testng/testng-6.8.jar" />

<!-- Include the Compiler Tree API stub because its types are used in some places. -->
Expand Down
7 changes: 7 additions & 0 deletions src/com/facebook/buck/testrunner/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ java_library(
"JUnitMain.java",
"JUnitRunner.java",
"JulLogFormatter.java",
"Junit4TestListener.java",
"Junit5TestListener.java",
"SameThreadFailOnTimeout.java",
],
source = "8",
Expand All @@ -51,7 +53,12 @@ java_library(
"//src/com/facebook/buck/test/result/type:type",
"//src/com/facebook/buck/test/selectors:selectors",
"//src/com/facebook/buck/util/concurrent:concurrent_for_junit_runner",
"//third-party/java/apiguardian-api:apiguardian-api",
"//third-party/java/junit:junit",
"//third-party/java/junit5-jupiter-api:junit5-jupiter-api",
"//third-party/java/junit5-platform-commons:junit5-platform-commons",
"//third-party/java/junit5-platform-engine:junit5-platform-engine",
"//third-party/java/junit5-platform-launcher:junit5-platform-launcher",
],
)

Expand Down
Loading

0 comments on commit 0add0af

Please sign in to comment.