Skip to content

Commit

Permalink
Support custom checkout paths
Browse files Browse the repository at this point in the history
  • Loading branch information
magaupp committed Oct 31, 2024
1 parent db4f3a5 commit 5dc159c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/templates/aeolus/c_sharp/default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ set -e
export AEOLUS_INITIAL_DIRECTORY=${PWD}
build () {
echo '⚙️ executing build'
dotnet build "./tests"
dotnet build "${testWorkingDirectory}"
}

test () {
echo '⚙️ executing test'
dotnet test --logger=junit "./tests"
dotnet test --logger=junit "${testWorkingDirectory}"
}

main () {
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/templates/aeolus/c_sharp/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ metadata:
id: c_sharp
actions:
- name: build
script: dotnet build "./tests"
script: dotnet build "${testWorkingDirectory}"
- name: test
script: dotnet test --logger=junit "./tests"
script: dotnet test --logger=junit "${testWorkingDirectory}"
results:
- name: NUnit Test Results
path: tests/TestResults/TestResults.xml
path: "${testWorkingDirectory}/TestResults/TestResults.xml"
type: junit
2 changes: 1 addition & 1 deletion src/main/resources/templates/c_sharp/test/test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\assignment\assignment.csproj" />
<ProjectReference Include="../${studentParentWorkingDirectoryName}/assignment.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ private void runTestSteps() {
*/
private void test() {
stage('Build') {
sh 'dotnet build "./tests"'
sh 'dotnet build "${testWorkingDirectory}"'
}
stage('Test') {
sh 'dotnet test --logger=junit "./tests"'
sh 'dotnet test --logger=junit "${testWorkingDirectory}"'
}
}

Expand All @@ -45,11 +45,11 @@ void postBuildTasks() {
sh '''
rm -rf results
mkdir results
if [ -e tests/TestResults/TestResults.xml ]
if [ -e "${testWorkingDirectory}/TestResults/TestResults.xml" ]
then
sed -i 's/<testsuites[^>]*>/<testsuite>/g ; s/<\\/testsuites>/<\\/testsuite>/g' tests/TestResults/TestResults.xml
sed -i 's/<testsuites[^>]*>/<testsuite>/g ; s/<\\/testsuites>/<\\/testsuite>/g' "${testWorkingDirectory}/TestResults/TestResults.xml"
fi
cp tests/TestResults/TestResults.xml $WORKSPACE/results/ || true
cp "${testWorkingDirectory}/TestResults/TestResults.xml" $WORKSPACE/results/ || true
sed -i 's/[^[:print:]\t]/�/g' $WORKSPACE/results/*.xml || true
'''
}
Expand Down

0 comments on commit 5dc159c

Please sign in to comment.