Skip to content

Commit

Permalink
feat(#125): skip None artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Oct 7, 2024
1 parent dfcccf9 commit 39fa47a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sr-data/src/sr_data/steps/maven.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def merge(build, repo):
artifact = plugin.find("./pom:artifactId", namespaces)
if group is not None:
plugins.append(f"{group.text}:{artifact.text}")
else:
elif artifact is not None:
plugins.append(artifact.text)
good.append(profile)
used = len(good)
Expand Down
19 changes: 19 additions & 0 deletions sr-data/src/tests/test_maven.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,25 @@ def test_skips_repos_without_maven(self):
frame = pd.read_csv(path)
self.assertTrue(len(frame) == 0)

@pytest.mark.nightly
def test_skips_plugin_without_artifact(self):
with TemporaryDirectory() as temp:
path = os.path.join(temp, "maven.csv")
main(
os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"to-maven-without-artifact.csv"
),
path,
os.environ["GH_TESTING_TOKEN"]
)
frame = pd.read_csv(path)
self.assertEqual(
frame.iloc[0]["plugins"],
"[org.jetbrains.kotlin:kotlin-maven-plugin,org.springframework.boot:spring-boot-maven-plugin]"
)


@pytest.mark.fast
def test_merges_projects_in_one_profile(self):
merged = merge(
Expand Down
2 changes: 2 additions & 0 deletions sr-data/src/tests/to-maven-without-artifact.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
repo,branch
habuma/spring-ai-examples,main

0 comments on commit 39fa47a

Please # to comment.