uncommenting add-user test (#1097)

* uncommenting add-user test

* quick-fix

* Ingestion script modified

* Airflow sample_usage modified, added sleep in curl commands

* adding chrome options for failing tests

* addressing reviewdog finding

* testing

* addressing reviewdog findings

Co-authored-by: Ayush Shah <ayush@getcollate.io>
This commit is contained in:
parthp2107 2021-11-15 09:46:39 +05:30 committed by GitHub
parent 3bc9c76bf1
commit 4a5f5e69b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 35 deletions

View File

@ -21,4 +21,6 @@ mvn -DskipTests clean package
echo "Docker compose up" echo "Docker compose up"
cd docker/local-metadata/ cd docker/local-metadata/
docker-compose up -d --build docker-compose up -d --build
echo "docker build done"
echo "waiting for data ingestion"
while ! wget -O /dev/null -o /dev/null localhost:8585/api/v1/teams/name/Finance; do sleep 5; done while ! wget -O /dev/null -o /dev/null localhost:8585/api/v1/teams/name/Finance; do sleep 5; done

View File

@ -52,6 +52,7 @@ public class DashboardDetailsPageTest {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver"); System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
ChromeOptions options = new ChromeOptions(); ChromeOptions options = new ChromeOptions();
options.addArguments("--headless"); options.addArguments("--headless");
options.addArguments("--window-size=1280,800");
webDriver = new ChromeDriver(options); webDriver = new ChromeDriver(options);
actions = new Actions(webDriver); actions = new Actions(webDriver);
wait = new WebDriverWait(webDriver, Duration.ofSeconds(30)); wait = new WebDriverWait(webDriver, Duration.ofSeconds(30));

View File

@ -53,6 +53,7 @@ public class TableDetailsPageTest {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver"); System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
ChromeOptions options = new ChromeOptions(); ChromeOptions options = new ChromeOptions();
options.addArguments("--headless"); options.addArguments("--headless");
options.addArguments("--window-size=1280,800");
webDriver = new ChromeDriver(options); webDriver = new ChromeDriver(options);
actions = new Actions(webDriver); actions = new Actions(webDriver);
wait = new WebDriverWait(webDriver, Duration.ofSeconds(30)); wait = new WebDriverWait(webDriver, Duration.ofSeconds(30));

View File

@ -85,19 +85,19 @@ public class TeamsPageTest {
Events.click(webDriver, By.cssSelector("[data-testid='saveButton']")); Events.click(webDriver, By.cssSelector("[data-testid='saveButton']"));
} }
// @Test @Test
// @Order(3) @Order(3)
// public void addUser() throws InterruptedException { public void addUser() throws InterruptedException {
// openTeamsPage(); openTeamsPage();
// Events.click(webDriver, By.xpath("//*[text()[contains(.,'"+ teamDisplayName +"')]] ")); Events.click(webDriver, By.xpath("//*[text()[contains(.,'" + teamDisplayName + "')]] "));
// // Select the created listed team // Select the created listed team
// for(int i = 0; i <=10; i++) { for (int i = 0; i <= 10; i++) {
// Events.click(webDriver, By.cssSelector("[data-testid='add-new-user-button']")); // select add user button Events.click(webDriver, By.cssSelector("[data-testid='add-new-user-button']")); // select add user button
// Events.click(webDriver, By.cssSelector("[data-testid='checkboxAddUser']")); Events.click(webDriver, By.cssSelector("[data-testid='checkboxAddUser']"));
// Events.click(webDriver, By.cssSelector("[data-testid='AddUserSave']")); Events.click(webDriver, By.cssSelector("[data-testid='AddUserSave']"));
// Thread.sleep(waitTime); Thread.sleep(waitTime);
// } }
// } }
@Test @Test
@Order(4) @Order(4)

View File

@ -33,6 +33,7 @@ default_args = {
"retries": 3, "retries": 3,
"retry_delay": timedelta(minutes=2), "retry_delay": timedelta(minutes=2),
"execution_timeout": timedelta(minutes=60), "execution_timeout": timedelta(minutes=60),
"schedule_interval": "*/5 * * * *",
} }
config = """ config = """

View File

@ -33,7 +33,7 @@ default_args = {
"email": ["username@org.com"], "email": ["username@org.com"],
"email_on_failure": False, "email_on_failure": False,
"retries": 3, "retries": 3,
"retry_delay": timedelta(minutes=5), "retry_delay": timedelta(seconds=10),
"execution_timeout": timedelta(minutes=60), "execution_timeout": timedelta(minutes=60),
} }

View File

@ -25,5 +25,7 @@ airflow users create \
--email spiderman@superhero.org \ --email spiderman@superhero.org \
--password admin --password admin
airflow db upgrade airflow db upgrade
(sleep 10; curl -u admin:admin --data '{"dag_run_id":"index_metadata"}' -H "Content-type: application/json" -X POST http://localhost:8080/api/v1/dags/index_metadata/dagRuns) & (while ! wget -O /dev/null -o /dev/null http://ingestion:8080; do sleep 5; done; sleep 5; curl -u admin:admin --data '{"dag_run_id":"sample_data_1"}' -H "Content-type: application/json" -X POST http://ingestion:8080/api/v1/dags/sample_data/dagRuns) &
(while ! wget -O /dev/null -o /dev/null http://ingestion:8080; do sleep 5; done; sleep 6; curl -u admin:admin --data '{"dag_run_id":"sample_usage_1"}' -H "Content-type: application/json" -X POST http://ingestion:8080/api/v1/dags/sample_usage/dagRuns) &
(while ! wget -O /dev/null -o /dev/null http://ingestion:8080; do sleep 5; done; sleep 7; curl -u admin:admin --data '{"dag_run_id":"index_metadata_1"}' -H "Content-type: application/json" -X POST http://ingestion:8080/api/v1/dags/index_metadata/dagRuns) &
airflow standalone airflow standalone