Skip to content

Commit

Permalink
Write tests log output to files, use base url in v1Migration external…
Browse files Browse the repository at this point in the history
… URL
  • Loading branch information
theotherp committed Jan 21, 2023
1 parent 3f47c70 commit 94d41c5
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 38 deletions.
46 changes: 26 additions & 20 deletions .github/workflows/system-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ jobs:
nzbhydra_port: ${{ matrix.test.port }}
nzbhydra.port: ${{ matrix.test.port }}
nzbhydra_name: ${{ matrix.test.name }}
NZBHYDRANAME: ${{ matrix.test.name }}
nzbhydra.name: ${{ matrix.test.name }}
nzbhydra_host_external: http://${{ matrix.test.name }}:5076
nzbhydra.host.external: http://${{ matrix.test.name }}:5076
steps:
- run: echo Running test ${{ matrix.test.name }} with port ${{ matrix.test.port }}
- uses: actions/checkout@v3
Expand Down Expand Up @@ -112,21 +111,28 @@ jobs:
echo "v1Migration container mounts:"
docker container inspect -f '{{ .Mounts}}' v1Migration
- name: "Run tests"
run: mvn --batch-mode test -pl org.nzbhydra.tests:system -DtrimStackTrace=false

- name: "Upload data folder artifact"
uses: actions/upload-artifact@v3
if: always()
with:
name: data
path: /tmp/hydra

- name: "Create test Report"
uses: dorny/test-reporter@v1
if: always()
continue-on-error: true
with:
name: System test report ${{ matrix.test.name }}
path: "**/surefire-reports/*.xml"
reporter: java-junit
- name: "Run tests"
run: mvn --batch-mode test -pl org.nzbhydra.tests:system -DtrimStackTrace=false

- name: "Upload data folder artifact"
uses: actions/upload-artifact@v3
if: always()
with:
name: data
path: /tmp/hydra

- name: "Upload test logs artifact"
uses: actions/upload-artifact@v3
if: always()
with:
name: { { matrix.test.name } }-test-logs
path: tests/**/*.log

- name: "Create test Report"
uses: dorny/test-reporter@v1
if: always()
continue-on-error: true
with:
name: System test report ${{ matrix.test.name }}
path: "**/surefire-reports/*.xml"
reporter: java-junit
22 changes: 5 additions & 17 deletions .run/All system tests v1Migration profile.run.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
<!--
~ (C) Copyright 2023 TheOtherP (theotherp@posteo.net)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All system tests v1Migration profile" type="JUnit" factoryName="JUnit">
<module name="system"/>
<option name="MAIN_CLASS_NAME" value=""/>
<option name="METHOD_NAME" value=""/>
<option name="TEST_OBJECT" value="directory"/>
<option name="VM_PARAMETERS" value="-Djunit.jupiter.extensions.autodetection.enabled=true -Dspring.profiles.active=systemtest,v1Migration"/>
<option name="VM_PARAMETERS"
value="-Djunit.jupiter.extensions.autodetection.enabled=true -Dspring.profiles.active=systemtest,v1Migration -Dnzbhydra.port=5077 -Dnzbhydra.mockUrl=http://mockserver:5080 -Dnzbhydra.host.external=http://core:5076"/>
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$"/>
<envs>
<env name="nzbhydra.name" value="v1Migration"/>
</envs>
<dir value="$PROJECT_DIR$/tests/system/src/test/java/org/nzbhydra"/>
<method v="2">
<option name="Make" enabled="true"/>
Expand Down
22 changes: 22 additions & 0 deletions tests/system/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<configuration>


<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/tests${NZBHYDRANAME}.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>


<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
nzbhydra.mockUrl=http://mockserver:5080
nzbhydra.host.external=http://core:5076
sonarr.host=http://sonarr:8989
radarr.host=http://radarr:7878

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nzbhydra.host.external=http://core:5076
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nzbhydra.host.external=http://v1Migration:5076/nzbhydra2

0 comments on commit 94d41c5

Please sign in to comment.