Skip to content

Commit

Permalink
Include aggregation in integration test (#1067)
Browse files Browse the repository at this point in the history
* Include aggregation in integration test

* Include github token for integration test

* Compare status code

---------

Co-authored-by: Ashley Davies <[email protected]>
  • Loading branch information
ashdavies and ashdavies authored Jul 15, 2024
1 parent d881e2c commit 1bde797
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
id: gradle_build
env:
FIREBASE_ANDROID_APP_ID: ${{ secrets.firebase_android_app_id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOOGLE_SERVICE_ACCOUNT_ID: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ID }}
INTEGRATION_API_KEY: ${{ secrets.integration_api_key }}
run: ./gradlew cloud-run:integrationTest --console=plain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import io.ktor.client.request.put
import io.ktor.client.request.setBody
import io.ktor.http.ContentType
import io.ktor.http.HttpHeaders
import io.ktor.http.HttpStatusCode
import io.ktor.http.contentType
import io.ktor.serialization.kotlinx.json.json
import io.ktor.server.application.Application
Expand Down Expand Up @@ -70,6 +71,15 @@ internal class ApplicationTest {

assertEquals(DEFAULT_LIMIT, events.size)
}

@Test
fun `should aggregate github events`() = testMainApplication { client ->
val response = client.post("/events:aggregate") {
contentType(ContentType.Application.Json)
}

assertEquals(HttpStatusCode.OK, response.status)
}
}

@KtorDsl
Expand Down

0 comments on commit 1bde797

Please sign in to comment.