Esfrie o Agente Smith ou execute milhares de testes sem servidor

Apresento a sua atenção a tradução de um artigo do Medium "Smith - Serverless Test Runner"





Tente se lembrar com que frequĂȘncia vocĂȘ se meteu nessa situação? Um dia antes do prazo, vocĂȘ executa um enorme conjunto de testes de integração e os deixa ferver durante a noite. E pela manhĂŁ, com horror nos olhos, vocĂȘ descobriu que metade deles veio de uma falha acidental de rede?





"-" -, . , ...





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





. , , , , ?





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





E a melhor parte Ă© que Ă© tudo grĂĄtis. Tanto Smith e Quack . Pegue, configure, execute, salve e aproveite. Bem, se vocĂȘ tiver alguma dĂșvida, os desenvolvedores da equipe GreatBit estĂŁo sempre com pressa para ajudar.












All Articles