Skip to content

Commit

Permalink
Merge pull request #14288 from smowton/smowton/admin/buildless-snapsh…
Browse files Browse the repository at this point in the history
…ot-repositories-test

Java: Add test re: buildless mode interaction with snapshot repositories
  • Loading branch information
smowton authored Sep 21, 2023
2 parents 2d44724 + 0b5727f commit 0aeec1a
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

<repositories>
<repository>
<id>snapshot-test-repo</id>
<url>http://localhost:9427/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.github.my.snapshot.test</groupId>
<artifactId>snapshottest</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<metadata modelVersion="1.1.0">
<groupId>com.github.my.snapshot.test</groupId>
<artifactId>snapshottest</artifactId>
<version>1.0-SNAPSHOT</version>
<versioning>
<lastUpdated>20230101020304</lastUpdated>
<snapshot>
<timestamp>20230901.050514</timestamp>
<buildNumber>100</buildNumber>
</snapshot>
<snapshotVersions>
<snapshotVersion>
<extension>jar</extension>
<value>1.0-20230901.050514-100</value>
<updated>20230101020304</updated>
</snapshotVersion>
<snapshotVersion>
<extension>pom</extension>
<value>1.0-20230901.050514-100</value>
<updated>20230101020304</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cf2064037098dc6d4294ef6f1a12dc75
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aeabf1dbf735290f5317d78459b3219d267dbb0e
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dbb202adb2f6c5504c9b29b93610dd9e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6db6f637a68116728830d5610cbafb608bc58a21
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.github.my.snapshot.test</groupId>
<artifactId>snapshottest</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
66c5f73407153610dc3f5743eef678f3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f895a88d2490dbcec8228c2a528bde029d80409e
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import testpkg.DepClass;

public class Test {

DepClass dc;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
diagnostics
#select
| DepClass |
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys

from create_database_utils import *
import subprocess

repo_server_process = subprocess.Popen(["python3", "-m", "http.server", "9427"], cwd = "repo")

try:
run_codeql_database_create([], lang="java", extra_args=["--extractor-option=buildless=true"], extra_env={"CODEQL_EXTRACTOR_JAVA_OPTION_BUILDLESS_CLASSPATH_FROM_BUILD_FILES": "true"})
finally:
repo_server_process.kill()

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import java
import semmle.code.java.Diagnostics

query predicate diagnostics(Diagnostic d) { any() }

from Class c
where c.getName() = "DepClass"
select c.toString()

0 comments on commit 0aeec1a

Please sign in to comment.