Cool Agent Smith or run thousands of Serverless tests

I present to your attention a translation of an article from Medium "Smith - Serverless Test Runner"





Try to remember how often you got into this situation? The day before the deadline, you run a massive set of integration tests and leave them to simmer overnight. And in the morning, with horror in your eyes, do you find out that half of them came from an accidental network failure?





"-" -, . , ...





, , , - ", - // "...





. , , , , ?





. , 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 - . . - QuAck .





, QuAck, , Smith Launcher. , - .









Smith - , . , , . , -.





And the best part is it's all free. Both Smith and QuAck . Take it, configure it, run it, save it and enjoy. Well, if you have any questions, the developers from the GreatBit team are always in a hurry to help.












All Articles