Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish artifacts for test fixtures #1201

Closed
liblit opened this issue Jan 8, 2023 · 11 comments · Fixed by #1207
Closed

Publish artifacts for test fixtures #1201

liblit opened this issue Jan 8, 2023 · 11 comments · Fixed by #1207
Assignees
Labels
enhancement gradle WALA’s Gradle build system

Comments

@liblit
Copy link
Contributor

liblit commented Jan 8, 2023

Artifacts relating to test fixtures are not currently published to the remote Sonatype repository. We should publish these too, though. See further discussion here.

@liblit liblit changed the title Publish test artifacts Publish artifacts for test fixtures Jan 8, 2023
@liblit liblit self-assigned this Jan 8, 2023
@liblit liblit added gradle WALA’s Gradle build system enhancement labels Jan 8, 2023
@khatchad
Copy link
Contributor

Related to #1171.

@msridhar
Copy link
Member

I see some test fixtures snapshot artifacts here:

https://oss.sonatype.org/content/repositories/snapshots/com/ibm/wala/com.ibm.wala.core/1.6.0-SNAPSHOT/

So this looks promising :-) @liblit would test-fixtures be the "classifier" for these artifacts? E.g., to refer to the WALA core test fixtures in Gradle, one could write 'com.ibm.wala:com.ibm.wala.core:X.Y.Z:test-fixtures' I think. Assuming yes, I can try to document that somewhere.

@liblit
Copy link
Contributor Author

liblit commented Jan 15, 2023

would test-fixtures be the "classifier" for these artifacts? E.g., to refer to the WALA core test fixtures in Gradle, one could write 'com.ibm.wala:com.ibm.wala.core:X.Y.Z:test-fixtures' I think.

I believe so. Looking at the Maven metadata for the latest com.ibm.wala.core snapshot, we see:

<snapshotVersion>
  <classifier>test-fixtures</classifier>
  <extension>jar</extension>
  <value>1.6.0-20230115.154234-25</value>
  <updated>20230115154234</updated>
</snapshotVersion>

A better test would be to use these newly available test fixtures in a non-WALA project. OK: done. com.ibm.wala.core.tests.util.WalaTestCase is published as part of the core test fixtures. I was able to use this class in a new Gradle project configured with the following build.gradle.kts:

plugins { id("java") }

repositories.maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }

dependencies { implementation("com.ibm.wala:com.ibm.wala.core:1.6.0-SNAPSHOT:test-fixtures") }

The best test of all would be to have @khatchad use the test fixtures. I believe that he already has some projects that rely on test-fixtures material. Those projects should now be able to pull what they need from the Sonatype snapshots repository in the style that I showed above in my example build.gradle.kts.

@khatchad
Copy link
Contributor

Thanks @liblit. I'll give it a shot. The wala/ML project is using Maven, so I'll need to translate it from the Gradle above.

khatchad added a commit to ponder-lab/ML that referenced this issue Jan 17, 2023
Per wala/WALA#1201 (comment). Will try the test fixture build from an online repo.
@khatchad
Copy link
Contributor

I removed the custom WALA build, but the test fixtures are now coming from the cache. I'll see if I can flush that.

@khatchad
Copy link
Contributor

OK, got the build to fail. Now that the custom build is gone, it looks like the test fixtures are being downloaded from a few different places (see: https://app.travis-ci.com/github/ponder-lab/ML/builds/259768708#L1351). It would seem that I need to change the WALA version to use the 1.6.0 snapshot version in order to get the newly released ones.

@liblit
Copy link
Contributor Author

liblit commented Jan 17, 2023

It would seem that I need to change the WALA version to use the 1.6.0 snapshot version in order to get the newly released ones.

Yes. The test fixtures that we are releasing are on the current WALA master branch, which produces 1.6.0-SNAPSHOT artifacts. We have not back-ported releasing of test fixtures to 1.5.x, and have no plans to do so.

@msridhar
Copy link
Member

If it's helpful I can cut a 1.6.0 release in a few days, @khatchad

@khatchad
Copy link
Contributor

Thanks, @msridhar. It looks like there's a few extra steps to enable snapshot dependencies. I'll take a hack at it and let yi9y know.

@msridhar
Copy link
Member

@khatchad if I release 1.6.0 you won't have to worry about enabling snapshot dependencies in wala/ML. Also, for build reproducibility, it'd be best if we could have wala/ML depend on a released version of WALA, not on changing snapshots. So, if you can wait a few days, I can release WALA 1.6.0 and then you can update wala/ML to rely on that version and (hopefully) not need to build WALA from source anymore.

@khatchad
Copy link
Contributor

Sounds good, @msridhar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement gradle WALA’s Gradle build system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants