-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ : cover job and stack page with percy
- Loading branch information
Showing
9 changed files
with
329 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.codeka.gaia.e2e | ||
|
||
import org.openqa.selenium.WebDriver | ||
import org.openqa.selenium.WebElement | ||
import org.openqa.selenium.support.FindBy | ||
|
||
class JobPage(webDriver: WebDriver) { | ||
|
||
init { | ||
if(! webDriver.currentUrl.contains("/jobs/")){ | ||
throw IllegalStateException("This is not the job page. Current page is ${webDriver.currentUrl}") | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.codeka.gaia.e2e | ||
|
||
import org.openqa.selenium.WebDriver | ||
import org.openqa.selenium.WebElement | ||
import org.openqa.selenium.support.FindBy | ||
|
||
class StackPage(webDriver: WebDriver) { | ||
|
||
init { | ||
if(! webDriver.currentUrl.contains("/stacks/")){ | ||
throw IllegalStateException("This is not the stack page. Current page is ${webDriver.currentUrl}") | ||
} | ||
} | ||
|
||
@FindBy(id="stack.name") | ||
private lateinit var nameInput: WebElement | ||
|
||
fun stackName() : String = nameInput.getAttribute("value") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
gaia = db.getSiblingDB('gaia'); | ||
gaia.job.drop(); | ||
gaia.job.insert([ | ||
{ | ||
"_id" : "32e4c316-287a-48ba-9c49-dd1b1a0204c8", | ||
"stackId" : "de28a01f-257a-448d-8e1b-00e4e3a41db2", | ||
"startDateTime" : ISODate("2020-02-03T18:03:12.227Z"), | ||
"endDateTime" : ISODate("2020-02-03T18:03:24.323Z"), | ||
"type" : "RUN", | ||
"status" : "APPLY_FINISHED", | ||
"terraformImage" : { | ||
"repository" : "hashicorp/terraform", | ||
"tag" : "latest" | ||
}, | ||
"steps" : [ | ||
{ | ||
"$ref" : "step", | ||
"$id" : "b3bcea1e-3fb8-4443-bd8b-1caab78e6922" | ||
}, | ||
{ | ||
"$ref" : "step", | ||
"$id" : "ec9d0334-0055-4727-aa79-731ea79326e3" | ||
} | ||
], | ||
"user" : { | ||
"$ref" : "user", | ||
"$id" : "selmak" | ||
}, | ||
"_class" : "io.codeka.gaia.stacks.bo.Job" | ||
}, | ||
{ | ||
"_id" : "5e856dc7-6bed-465f-abf1-02980206ab2a", | ||
"stackId" : "de28a01f-257a-448d-8e1b-00e4e3a41db2", | ||
"startDateTime" : ISODate("2020-02-05T07:01:30.875Z"), | ||
"endDateTime" : ISODate("2020-02-05T07:02:18.625Z"), | ||
"type" : "RUN", | ||
"status" : "APPLY_FINISHED", | ||
"terraformImage" : { | ||
"repository" : "hashicorp/terraform", | ||
"tag" : "latest" | ||
}, | ||
"steps" : [ | ||
{ | ||
"$ref" : "step", | ||
"$id" : "0ddcb316-8681-4416-bc59-f3e7d47836f1" | ||
}, | ||
{ | ||
"$ref" : "step", | ||
"$id" : "e294e7a2-abb7-4c0b-9102-5fb72ad42292" | ||
} | ||
], | ||
"user" : { | ||
"$ref" : "user", | ||
"$id" : "selmak" | ||
}, | ||
"_class" : "io.codeka.gaia.stacks.bo.Job" | ||
} | ||
|
||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
gaia = db.getSiblingDB('gaia'); | ||
gaia.step.drop(); | ||
gaia.step.insert([ | ||
{ | ||
"_id" : "b3bcea1e-3fb8-4443-bd8b-1caab78e6922", | ||
"jobId" : "32e4c316-287a-48ba-9c49-dd1b1a0204c8", | ||
"startDateTime" : ISODate("2020-02-03T18:03:12.227Z"), | ||
"endDateTime" : ISODate("2020-02-03T18:03:17.035Z"), | ||
"executionTime" : NumberLong(4807), | ||
"type" : "PLAN", | ||
"status" : "FINISHED", | ||
"logs" : "", | ||
"_class" : "io.codeka.gaia.stacks.bo.Step" | ||
}, | ||
{ | ||
"_id" : "ec9d0334-0055-4727-aa79-731ea79326e3", | ||
"jobId" : "32e4c316-287a-48ba-9c49-dd1b1a0204c8", | ||
"startDateTime" : ISODate("2020-02-03T18:03:19.301Z"), | ||
"endDateTime" : ISODate("2020-02-03T18:03:24.323Z"), | ||
"executionTime" : NumberLong(5021), | ||
"type" : "APPLY", | ||
"status" : "FINISHED", | ||
"logs" : "using image hashicorp/terraform:latest\ncloning https://oauth2:[MASKED]@github.com/juwit/terraform-docker-mongo\nCloning into 'module'...\ngenerating backend configuration\nTerraform v0.12.20\n\n\u001b[0m\u001b[1mInitializing the backend...\u001b[0m\n\u001b[0m\u001b[32m\nSuccessfully configured the backend \"http\"! Terraform will automatically\nuse this backend unless the backend configuration changes.\u001b[0m\n\n\u001b[0m\u001b[1mInitializing provider plugins...\u001b[0m\n- Checking for available provider plugins...\n- Downloading plugin for provider \"docker\" (terraform-providers/docker) 2.6.0...\n\nThe following providers do not have any version constraints in configuration,\nso the latest version was installed.\n\nTo prevent automatic upgrades to new major versions that may contain breaking\nchanges, it is recommended to add version = \"...\" constraints to the\ncorresponding provider blocks in configuration, with the constraint strings\nsuggested below.\n\n* provider.docker: version = \"~> 2.6\"\n\n\u001b[0m\u001b[1m\u001b[32mTerraform has been successfully initialized!\u001b[0m\u001b[32m\u001b[0m\n\u001b[0m\u001b[1mdocker_image.mongo: Creating...\u001b[0m\u001b[0m\n\u001b[0m\u001b[1mdocker_image.mongo: Creation complete after 0s [id=sha256:5976dac61f4fb85c1a2d1f7c717600f9c78fb02badba6b3c5961a4091ef75905mongo]\u001b[0m\u001b[0m\n\u001b[0m\u001b[1mdocker_container.mongo: Creating...\u001b[0m\u001b[0m\n\u001b[0m\u001b[1mdocker_container.mongo: Creation complete after 1s [id=b247c86c6cee2c3ad6e9565c48cae29877374d07f7c6be5f42489002bdf66b42]\u001b[0m\u001b[0m\n\u001b[0m\u001b[1m\u001b[32m\nApply complete! Resources: 2 added, 0 changed, 0 destroyed.\u001b[0m\n\u001b[0m\u001b[1m\u001b[32m\nOutputs:\n\ndocker_container_name = test\u001b[0m\n", | ||
"_class" : "io.codeka.gaia.stacks.bo.Step" | ||
}, | ||
{ | ||
"_id" : "0ddcb316-8681-4416-bc59-f3e7d47836f1", | ||
"jobId" : "5e856dc7-6bed-465f-abf1-02980206ab2a", | ||
"startDateTime" : ISODate("2020-02-05T07:01:30.875Z"), | ||
"endDateTime" : ISODate("2020-02-05T07:01:37.393Z"), | ||
"executionTime" : NumberLong(6518), | ||
"type" : "PLAN", | ||
"status" : "FINISHED", | ||
"logs" : "", | ||
"_class" : "io.codeka.gaia.stacks.bo.Step" | ||
}, | ||
{ | ||
"_id" : "e294e7a2-abb7-4c0b-9102-5fb72ad42292", | ||
"jobId" : "5e856dc7-6bed-465f-abf1-02980206ab2a", | ||
"startDateTime" : ISODate("2020-02-05T07:02:13.086Z"), | ||
"endDateTime" : ISODate("2020-02-05T07:02:18.625Z"), | ||
"executionTime" : NumberLong(5539), | ||
"type" : "APPLY", | ||
"status" : "FINISHED", | ||
"logs" : "using image hashicorp/terraform:latest\ncloning https://oauth2:[MASKED]@github.com/juwit/terraform-docker-mongo\nCloning into 'module'...\ngenerating backend configuration\nTerraform v0.12.20\n\n\u001b[0m\u001b[1mInitializing the backend...\u001b[0m\n\u001b[0m\u001b[32m\nSuccessfully configured the backend \"http\"! Terraform will automatically\nuse this backend unless the backend configuration changes.\u001b[0m\n\n\u001b[0m\u001b[1mInitializing provider plugins...\u001b[0m\n- Checking for available provider plugins...\n- Downloading plugin for provider \"docker\" (terraform-providers/docker) 2.6.0...\n\nThe following providers do not have any version constraints in configuration,\nso the latest version was installed.\n\nTo prevent automatic upgrades to new major versions that may contain breaking\nchanges, it is recommended to add version = \"...\" constraints to the\ncorresponding provider blocks in configuration, with the constraint strings\nsuggested below.\n\n* provider.docker: version = \"~> 2.6\"\n\n\u001b[0m\u001b[1m\u001b[32mTerraform has been successfully initialized!\u001b[0m\u001b[32m\u001b[0m\n\u001b[0m\u001b[1mdocker_image.mongo: Refreshing state... [id=sha256:5976dac61f4fb85c1a2d1f7c717600f9c78fb02badba6b3c5961a4091ef75905mongo]\u001b[0m\n\u001b[0m\u001b[1mdocker_container.mongo: Refreshing state... [id=b247c86c6cee2c3ad6e9565c48cae29877374d07f7c6be5f42489002bdf66b42]\u001b[0m\n\u001b[0m\u001b[1mdocker_container.mongo: Creating...\u001b[0m\u001b[0m\n\u001b[0m\u001b[1mdocker_container.mongo: Creation complete after 0s [id=330b26c77d65e106df926454f9c3c3448f30c4a79062daefe66fe1d4a8f2970e]\u001b[0m\u001b[0m\n\u001b[0m\u001b[1m\u001b[32m\nApply complete! Resources: 1 added, 0 changed, 0 destroyed.\u001b[0m\n\u001b[0m\u001b[1m\u001b[32m\nOutputs:\n\ndocker_container_name = local-mongo\u001b[0m\n", | ||
"_class" : "io.codeka.gaia.stacks.bo.Step" | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
gaia = db.getSiblingDB('gaia'); | ||
gaia.terraformState.drop(); | ||
gaia.terraformState.insert([ | ||
{ | ||
"_id" : "de28a01f-257a-448d-8e1b-00e4e3a41db2", | ||
"value" : { | ||
"version" : 4, | ||
"terraform_version" : "0.12.20", | ||
"serial" : 0, | ||
"lineage" : "ea06e653-352b-ec53-90c5-58699c6c9043", | ||
"outputs" : { | ||
"docker_container_name" : { | ||
"value" : "test", | ||
"type" : "string" | ||
} | ||
}, | ||
"resources" : [ | ||
{ | ||
"mode" : "managed", | ||
"type" : "docker_container", | ||
"name" : "mongo", | ||
"provider" : "provider.docker", | ||
"instances" : [ | ||
{ | ||
"schema_version" : 1, | ||
"attributes" : { | ||
"attach" : false, | ||
"bridge" : "", | ||
"capabilities" : [], | ||
"command" : null, | ||
"container_logs" : null, | ||
"cpu_set" : null, | ||
"cpu_shares" : null, | ||
"destroy_grace_seconds" : null, | ||
"devices" : [], | ||
"dns" : null, | ||
"dns_opts" : null, | ||
"dns_search" : null, | ||
"domainname" : null, | ||
"entrypoint" : null, | ||
"env" : null, | ||
"exit_code" : null, | ||
"gateway" : "172.17.0.1", | ||
"group_add" : null, | ||
"healthcheck" : [], | ||
"host" : [], | ||
"hostname" : null, | ||
"id" : "b247c86c6cee2c3ad6e9565c48cae29877374d07f7c6be5f42489002bdf66b42", | ||
"image" : "sha256:5976dac61f4fb85c1a2d1f7c717600f9c78fb02badba6b3c5961a4091ef75905", | ||
"ip_address" : "172.17.0.3", | ||
"ip_prefix_length" : 16, | ||
"ipc_mode" : null, | ||
"labels" : null, | ||
"links" : null, | ||
"log_driver" : "json-file", | ||
"log_opts" : null, | ||
"logs" : false, | ||
"max_retry_count" : null, | ||
"memory" : null, | ||
"memory_swap" : null, | ||
"mounts" : [], | ||
"must_run" : true, | ||
"name" : "test", | ||
"network_alias" : null, | ||
"network_data" : [ | ||
{ | ||
"gateway" : "172.17.0.1", | ||
"ip_address" : "172.17.0.3", | ||
"ip_prefix_length" : 16, | ||
"network_name" : "bridge" | ||
} | ||
], | ||
"network_mode" : null, | ||
"networks" : null, | ||
"networks_advanced" : [], | ||
"pid_mode" : null, | ||
"ports" : [ | ||
{ | ||
"external" : 28017, | ||
"internal" : 27017, | ||
"ip" : "0.0.0.0", | ||
"protocol" : "tcp" | ||
} | ||
], | ||
"privileged" : null, | ||
"publish_all_ports" : null, | ||
"read_only" : false, | ||
"restart" : "no", | ||
"rm" : false, | ||
"shm_size" : null, | ||
"start" : true, | ||
"sysctls" : null, | ||
"tmpfs" : null, | ||
"ulimit" : [], | ||
"upload" : [], | ||
"user" : null, | ||
"userns_mode" : null, | ||
"volumes" : [], | ||
"working_dir" : null | ||
}, | ||
"private" : "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==", | ||
"dependencies" : [ | ||
"docker_image.mongo" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"mode" : "managed", | ||
"type" : "docker_image", | ||
"name" : "mongo", | ||
"provider" : "provider.docker", | ||
"instances" : [ | ||
{ | ||
"schema_version" : 0, | ||
"attributes" : { | ||
"id" : "sha256:5976dac61f4fb85c1a2d1f7c717600f9c78fb02badba6b3c5961a4091ef75905mongo", | ||
"keep_locally" : true, | ||
"latest" : "sha256:5976dac61f4fb85c1a2d1f7c717600f9c78fb02badba6b3c5961a4091ef75905", | ||
"name" : "mongo", | ||
"pull_trigger" : null, | ||
"pull_triggers" : null | ||
}, | ||
"private" : "bnVsbA==" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"_class" : "io.codeka.gaia.stacks.bo.TerraformState" | ||
} | ||
]); |