Ich präsentiere Ihnen eine Übersetzung eines Artikels aus Medium "Smith - Serverless Test Runner".
Versuchen Sie sich zu erinnern, wie oft Sie in diese Situation geraten sind? Am Tag vor Ablauf der Frist führen Sie eine Reihe von Integrationstests durch und lassen sie über Nacht köcheln. Und stellen Sie am Morgen mit Entsetzen in den Augen fest, dass die Hälfte von ihnen auf einen versehentlichen Netzwerkausfall zurückzuführen ist?
"-" -, . , ...
, , , - ", - // "...
. , , , , ?
. , 4 . 2 -, . 20 " ", . , , . 100% "" . . ... , !
- Smith. , , , , .
Serverless , - AWS. , Smith AWS.
Smith REST-api . API Gateway Lambda-, , ECS-. ECS " ", ( ). S3, SQS, "". ECS-, , "". , .
, , , 89% " -". Smith , 100%.
Smith - Cloud Formation , . . , , Serverless : S3 , SQS , , API Gateway ECS .
, , API- POST- . :
{"launchId": "ID_OF_TEST_LAUNCH", "executables": [
{ "testcaseUuid": "1", "metadata": { "projectId":"com.testquack", "artifactId":"smith-maven-s3-tests", "version":"1.0-SNAPSHOT", "package":"com.testquack.smith.maven", "class":"TestScopeTest", "method":"resourceDataTest"}},
{"testcaseUuid": "2", "metadata": { "projectId":"com.testquack", "artifactId":"smith-maven-s3-tests", "version":"1.0-SNAPSHOT", "package":"com.testquack.smith.maven", "class":"TestScopeTest", "method":"simpleTest"}},
{"testcaseUuid": "3", "metadata": { "projectId":"com.testquack", "artifactId":"smith-maven-s3-tests", "version":"1.0-SNAPSHOT", "package":"com.testquack.smith.maven", "class":"TestScopeTest", "method":"simpleTest"}},
]
}
( "method" ) ECS-. S3- “smith-reports-[REGION]-[ACCOUNT_ID]”, - , - - “smith-results” SQS.
Smith Maven JUnit . Gradle, NUnit, Pytest, ..
Smith , .
test-jar.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
Smith-. , Maven Central - - . , , - .
Smith- settings.xml “smith-private-settings-[REGION]-[ACCOUNT_ID]”, . settings.xml ECS Maven- .
- S3, Smith. build wagon-plugin
<build>
<extensions>
<extension>
<groupId>com.testquack.smith</groupId>
<artifactId>s3-storage-wagon</artifactId>
<version>1.0</version>
</extension>
</extensions>
...
</build>
- ~/.m2/settings.xml AWS-:
<server>
<id>my-repo-bucket-snapshot</id>
<username>AWS_ACCESS_KEY</username>
<password>AWS_SECRET_KEY</password>
<configuration>
<region>us-east-1</region>
</configuration>
</server>
<server>
<id>my-repo-bucket-release</id>
<username>AWS_ACCESS_KEY</username>
<password>AWS_SECRET_KEY</password>
<configuration>
<region>us-east-1</region>
</configuration>
</server>
, , distribution management pom- ,
<distributionManagement>
<snapshotRepository>
<id>my-repo-bucket-snapshot</id>
<url>s3://smith-artifacts-snapshot-[REGION]-[ACCOUNT_ID]</url>
</snapshotRepository>
<repository>
<id>my-repo-bucket-release</id>
<url>s3://smith-artifacts-release-[REGION]-[ACCOUNT_ID]</url>
</repository>
</distributionManagement>
, “mvn clean deploy” , Smith. API .
- Smith API Gateway , POST- . , , .
.. Smith GreatBit, . - - QuAck. QuAck Smith Launcher - , Serverless Smith . , QuAck , .
, QuAck, , Smith Launcher. , - .
Smith - , . , , . , -.
Und das Beste daran ist, dass alles kostenlos ist. Sowohl Smith als auch QuAck . Nehmen Sie es, konfigurieren Sie es, führen Sie es aus, speichern Sie es und genießen Sie es. Wenn Sie Fragen haben, haben die Entwickler des GreatBit-Teams es immer eilig, Ihnen zu helfen.