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

Add workflow to build package and run tests #8

Merged
merged 15 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'adopt'

- name: Install Maven
run: |
sudo rm -rf /usr/bin/mvn
sudo wget -q -O - "https://apache.osuosl.org/maven/maven-3/3.9.8/binaries/apache-maven-3.9.8-bin.tar.gz" | sudo tar xzf - -C /usr/share
sudo ln -s /usr/share/apache-maven-3.9.8/bin/mvn /usr/bin/mvn

- name: Build with Maven
run: mvn -B package --file pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static String formatVertexInfoWithinCycle(String vertexName, MethodCallGr
}

return localized("ast.method.get_formatted_file_string_prefix", pathOfSourceRoot.toString()
+ "/" + Objects.requireNonNull(extractClassName(vertexName)))
+ File.separator + Objects.requireNonNull(extractClassName(vertexName)))
+ System.lineSeparator()
+ localized("ast.method.get_formatted_unwanted_node_string_prefix",
"Unwanted Recursion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,7 @@ void test_testExcludesPassedMethods_Success() {
void test_testExcludesPassedMethod_Fail() {
String testExcludesPassedMethod_Fail = "testExcludesPassedMethod_Fail";
tests.assertThatEvents().haveExactly(1, testFailedWith(testExcludesPassedMethod_Fail, AssertionError.class, "Unwanted statement found:" + System.lineSeparator() + " - In "
+ Path.of("src", "test", "java", "de", "tum", "cit", "ase", "ares", "integration", "testuser", "subject", "structural", "astTestFiles", "recursions" , "excludeMethods",
"ClassWithNoExcludeMethods.java")
+ Path.of("src", "test", "java", "de", "tum", "cit", "ase", "ares", "integration", "testuser", "subject", "structural", "astTestFiles", "recursions" , "excludeMethods", "ClassWithNoExcludeMethods.java")
+ ":" + System.lineSeparator() + " - Unwanted Recursion was found:"
+ System.lineSeparator() + " - Between line 5 (column 5) and line 7 (column 5) in Method de.tum.cit.ase.ares.integration.testuser.subject.structural.astTestFiles.recursions.excludeMethods.ClassWithNoExcludeMethods.something(de.tum.cit.ase.ares.integration.testuser.subject.structural.astTestFiles.recursions.excludeMethods.RandomParameterThatShouldBeResolved)" + System.lineSeparator()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ void accessPathTest() throws IOException {
}

@PublicTest
@Policy(value = "src/test/resources/de/tum/cit/ase/ares/integration/testuser/securitypolicies/NoAllowedPathPolicy.yaml", withinPath = "test-classes/de/tum/cit/ase/ares/integration/testuser/subject/pathaccess")
void weAccessPath() throws IOException {
Files.readString(Path.of("pom.xml"));
}
Expand Down
Loading