Skip to content

Commit

Permalink
fix: remove e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fredleger committed Nov 4, 2023
1 parent b1f0ed6 commit 5096a9c
Showing 1 changed file with 6 additions and 28 deletions.
34 changes: 6 additions & 28 deletions .dagger/ci.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import random
import sys
import uuid

import anyio
import dagger
Expand Down Expand Up @@ -47,7 +48,7 @@ async def main():
)
print(lint)

# [ STAGE 3 | STEP 2 ] : e2e tests
# [ STAGE 3 | STEP 2 ] : unit tests
# run unit tests
print("Running unit tests")
unit = (
Expand All @@ -59,36 +60,13 @@ async def main():
)
print(unit)

# [ STAGE 3 | STEP 2 ] : e2e tests
# run e2e tests
print("Running e2e tests")
print("Starting db service")
mongo = (
client.container()
.from_("mongo:5")
.with_env_variable("MONGO_INITDB_ROOT_USERNAME", "root")
.with_env_variable("MONGO_INITDB_ROOT_PASSWORD", "root")
.with_exposed_port(27017)
.with_exec([])
)

print("Running app")
app = (
docker_image_dev.with_directory("/code", src)
.with_workdir("/code")
.with_env_variable("MONGO_HOST", "mongo")
.with_exec(["/bin/bash", "./scripts/start.sh"])
.with_exec(["/bin/bash", "-c", "cd realworld && npm ci"])
.with_service_binding("mongo", mongo)
)

e2e = await (app.with_exec(["/bin/bash", "scripts/test.sh"]).stdout())
print(e2e)

# [ STAGE 4 | STEP 1 ] : publish
# publish docker image
print("Publishing docker image")
await docker_image_dev.publish()
id = str(uuid.uuid4())
tag = f"ttl.sh/meetup-{id}:1h"
await docker_image.publish(tag)
print(f"Published {tag}")


anyio.run(main)

0 comments on commit 5096a9c

Please sign in to comment.