|
40 | 40 | <properties> |
41 | 41 | <maven.compiler.release>17</maven.compiler.release> |
42 | 42 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 43 | + <!-- Directory where the copilot-sdk repo will be cloned for tests --> |
| 44 | + <copilot.sdk.clone.dir>${project.build.directory}/copilot-sdk</copilot.sdk.clone.dir> |
| 45 | + <copilot.tests.dir>${copilot.sdk.clone.dir}/test</copilot.tests.dir> |
43 | 46 | </properties> |
44 | 47 |
|
45 | 48 | <dependencies> |
|
76 | 79 | <artifactId>maven-compiler-plugin</artifactId> |
77 | 80 | <version>3.14.1</version> |
78 | 81 | </plugin> |
| 82 | + <!-- Clone the official copilot-sdk repository for test resources --> |
| 83 | + <plugin> |
| 84 | + <groupId>org.codehaus.mojo</groupId> |
| 85 | + <artifactId>exec-maven-plugin</artifactId> |
| 86 | + <version>3.6.2</version> |
| 87 | + <executions> |
| 88 | + <execution> |
| 89 | + <id>clone-copilot-sdk</id> |
| 90 | + <phase>generate-test-resources</phase> |
| 91 | + <goals> |
| 92 | + <goal>exec</goal> |
| 93 | + </goals> |
| 94 | + <configuration> |
| 95 | + <executable>git</executable> |
| 96 | + <arguments> |
| 97 | + <argument>clone</argument> |
| 98 | + <argument>--depth</argument> |
| 99 | + <argument>1</argument> |
| 100 | + <argument>https://github.com/github/copilot-sdk.git</argument> |
| 101 | + <argument>${copilot.sdk.clone.dir}</argument> |
| 102 | + </arguments> |
| 103 | + <successCodes> |
| 104 | + <successCode>0</successCode> |
| 105 | + <successCode>128</successCode> <!-- Already exists --> |
| 106 | + </successCodes> |
| 107 | + </configuration> |
| 108 | + </execution> |
| 109 | + <execution> |
| 110 | + <id>install-harness-dependencies</id> |
| 111 | + <phase>generate-test-resources</phase> |
| 112 | + <goals> |
| 113 | + <goal>exec</goal> |
| 114 | + </goals> |
| 115 | + <configuration> |
| 116 | + <executable>npm</executable> |
| 117 | + <workingDirectory>${copilot.sdk.clone.dir}/test/harness</workingDirectory> |
| 118 | + <arguments> |
| 119 | + <argument>install</argument> |
| 120 | + </arguments> |
| 121 | + </configuration> |
| 122 | + </execution> |
| 123 | + </executions> |
| 124 | + </plugin> |
79 | 125 | <plugin> |
80 | 126 | <groupId>org.apache.maven.plugins</groupId> |
81 | 127 | <artifactId>maven-surefire-plugin</artifactId> |
82 | 128 | <version>3.5.4</version> |
| 129 | + <configuration> |
| 130 | + <systemPropertyVariables> |
| 131 | + <copilot.tests.dir>${copilot.tests.dir}</copilot.tests.dir> |
| 132 | + <copilot.sdk.dir>${copilot.sdk.clone.dir}</copilot.sdk.dir> |
| 133 | + </systemPropertyVariables> |
| 134 | + </configuration> |
83 | 135 | </plugin> |
84 | 136 | <plugin> |
85 | 137 | <groupId>com.diffplug.spotless</groupId> |
|
0 commit comments