mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-25 16:08:46 +09:00
Remove external service dependencies in migration tests (#36866)
Fix #36859 Replace live third-party API calls in migration tests with a fixture-based HTTP mock server. Fixtures are committed so tests run offline by default; live recording is gated per service on an API-token env var. Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ticketing-milestone type="array">
|
||||
<ticketing-milestone>
|
||||
<id type="integer">1</id>
|
||||
<identifier>milestone1</identifier>
|
||||
<name>Milestone1</name>
|
||||
<deadline type="date">2021-09-16</deadline>
|
||||
<description></description>
|
||||
<status>active</status>
|
||||
</ticketing-milestone>
|
||||
<ticketing-milestone>
|
||||
<id type="integer">2</id>
|
||||
<identifier>milestone2</identifier>
|
||||
<name>Milestone2</name>
|
||||
<deadline type="date">2021-09-17</deadline>
|
||||
<description></description>
|
||||
<status>closed</status>
|
||||
</ticketing-milestone>
|
||||
</ticketing-milestone>
|
||||
@@ -0,0 +1,10 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<repository>
|
||||
<name>test</name>
|
||||
<description>Repository Description</description>
|
||||
<permalink>test</permalink>
|
||||
<clone-url>git@codebasehq.com:gitea-test/gitea-test/test.git</clone-url>
|
||||
<source></source>
|
||||
</repository>
|
||||
@@ -0,0 +1,8 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<commits type="array">
|
||||
<commit>
|
||||
<ref>f32b0a9dfd09a60f616f29158f772cedd89942d2</ref>
|
||||
</commit>
|
||||
</commits>
|
||||
@@ -0,0 +1,8 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<commits type="array">
|
||||
<commit>
|
||||
<ref>1287f206b888d4d13540e0a8e1c07458f5420059</ref>
|
||||
</commit>
|
||||
</commits>
|
||||
@@ -0,0 +1,22 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<merge-request>
|
||||
<id type="integer">100</id>
|
||||
<source-ref>readme-mr</source-ref>
|
||||
<target-ref>master</target-ref>
|
||||
<subject>Readme Change</subject>
|
||||
<status>new</status>
|
||||
<user-id type="integer">43</user-id>
|
||||
<created-at type="datetime">2021-09-26T20:25:47+00:00</created-at>
|
||||
<updated-at type="datetime">2021-09-26T20:25:47+00:00</updated-at>
|
||||
<comments type="array">
|
||||
<comment>
|
||||
<content>Merge Request comment</content>
|
||||
<id type="integer">300</id>
|
||||
<user-id type="integer">43</user-id>
|
||||
<action nil="true"></action>
|
||||
<created-at type="datetime">2021-09-26T20:25:47+00:00</created-at>
|
||||
</comment>
|
||||
</comments>
|
||||
</merge-request>
|
||||
@@ -0,0 +1,8 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<merge-requests type="array">
|
||||
<merge-request>
|
||||
<id type="integer">100</id>
|
||||
</merge-request>
|
||||
</merge-requests>
|
||||
@@ -0,0 +1,41 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tickets type="array">
|
||||
<ticket>
|
||||
<ticket-id type="integer">2</ticket-id>
|
||||
<summary>Open Ticket</summary>
|
||||
<ticket-type>Feature</ticket-type>
|
||||
<reporter-id type="integer">43</reporter-id>
|
||||
<reporter>gitea-test-43</reporter>
|
||||
<type>
|
||||
<name>Feature</name>
|
||||
</type>
|
||||
<status>
|
||||
<treat-as-closed type="boolean">false</treat-as-closed>
|
||||
</status>
|
||||
<milestone>
|
||||
<name></name>
|
||||
</milestone>
|
||||
<updated-at type="datetime">2021-09-26T19:19:34+00:00</updated-at>
|
||||
<created-at type="datetime">2021-09-26T19:19:14+00:00</created-at>
|
||||
</ticket>
|
||||
<ticket>
|
||||
<ticket-id type="integer">1</ticket-id>
|
||||
<summary>Closed Ticket</summary>
|
||||
<ticket-type>Bug</ticket-type>
|
||||
<reporter-id type="integer">43</reporter-id>
|
||||
<reporter>gitea-test-43</reporter>
|
||||
<type>
|
||||
<name>Bug</name>
|
||||
</type>
|
||||
<status>
|
||||
<treat-as-closed type="boolean">true</treat-as-closed>
|
||||
</status>
|
||||
<milestone>
|
||||
<name>Milestone1</name>
|
||||
</milestone>
|
||||
<updated-at type="datetime">2021-09-26T19:18:55+00:00</updated-at>
|
||||
<created-at type="datetime">2021-09-26T19:18:33+00:00</created-at>
|
||||
</ticket>
|
||||
</tickets>
|
||||
@@ -0,0 +1,12 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ticket-notes type="array">
|
||||
<ticket-note>
|
||||
<content>Closed Ticket Message</content>
|
||||
<created-at type="datetime">2021-09-26T19:18:33+00:00</created-at>
|
||||
<updated-at type="datetime">2021-09-26T19:18:33+00:00</updated-at>
|
||||
<id type="integer">200</id>
|
||||
<user-id type="integer">43</user-id>
|
||||
</ticket-note>
|
||||
</ticket-notes>
|
||||
@@ -0,0 +1,19 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ticket-notes type="array">
|
||||
<ticket-note>
|
||||
<content>Open Ticket Message</content>
|
||||
<created-at type="datetime">2021-09-26T19:19:14+00:00</created-at>
|
||||
<updated-at type="datetime">2021-09-26T19:19:14+00:00</updated-at>
|
||||
<id type="integer">100</id>
|
||||
<user-id type="integer">43</user-id>
|
||||
</ticket-note>
|
||||
<ticket-note>
|
||||
<content>open comment</content>
|
||||
<created-at type="datetime">2021-09-26T19:19:34+00:00</created-at>
|
||||
<updated-at type="datetime">2021-09-26T19:19:34+00:00</updated-at>
|
||||
<id type="integer">101</id>
|
||||
<user-id type="integer">43</user-id>
|
||||
</ticket-note>
|
||||
</ticket-notes>
|
||||
@@ -0,0 +1,21 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ticketing-types type="array">
|
||||
<ticketing-type>
|
||||
<id type="integer">1</id>
|
||||
<name>Bug</name>
|
||||
</ticketing-type>
|
||||
<ticketing-type>
|
||||
<id type="integer">2</id>
|
||||
<name>Feature</name>
|
||||
</ticketing-type>
|
||||
<ticketing-type>
|
||||
<id type="integer">3</id>
|
||||
<name>Enhancement</name>
|
||||
</ticketing-type>
|
||||
<ticketing-type>
|
||||
<id type="integer">4</id>
|
||||
<name>Task</name>
|
||||
</ticketing-type>
|
||||
</ticketing-types>
|
||||
@@ -0,0 +1,12 @@
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<users type="array">
|
||||
<user>
|
||||
<email-address>gitea-codebase@smack.email</email-address>
|
||||
<id type="integer">43</id>
|
||||
<last-name>Test</last-name>
|
||||
<first-name>Gitea</first-name>
|
||||
<username>gitea-test-43</username>
|
||||
</user>
|
||||
</users>
|
||||
Reference in New Issue
Block a user