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"
cd docker/local-metadata/
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

View File

@ -47,16 +47,17 @@ public class DashboardDetailsPageTest {
static Actions actions;
static WebDriverWait wait;
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
webDriver = new ChromeDriver(options);
actions = new Actions(webDriver);
wait = new WebDriverWait(webDriver, Duration.ofSeconds(30));
webDriver.manage().window().maximize();
webDriver.get(url);
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");
webDriver = new ChromeDriver(options);
actions = new Actions(webDriver);
wait = new WebDriverWait(webDriver, Duration.ofSeconds(30));
webDriver.manage().window().maximize();
webDriver.get(url);
}
@Test

View File

@ -48,16 +48,17 @@ public class TableDetailsPageTest {
static Actions actions;
static WebDriverWait wait;
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
webDriver = new ChromeDriver(options);
actions = new Actions(webDriver);
wait = new WebDriverWait(webDriver, Duration.ofSeconds(30));
webDriver.manage().window().maximize();
webDriver.get(url);
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");
webDriver = new ChromeDriver(options);
actions = new Actions(webDriver);
wait = new WebDriverWait(webDriver, Duration.ofSeconds(30));
webDriver.manage().window().maximize();
webDriver.get(url);
}
@Test

View File

@ -85,19 +85,19 @@ public class TeamsPageTest {
Events.click(webDriver, By.cssSelector("[data-testid='saveButton']"));
}
// @Test
// @Order(3)
// public void addUser() throws InterruptedException {
// openTeamsPage();
// Events.click(webDriver, By.xpath("//*[text()[contains(.,'"+ teamDisplayName +"')]] "));
// // Select the created listed team
// 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='checkboxAddUser']"));
// Events.click(webDriver, By.cssSelector("[data-testid='AddUserSave']"));
// Thread.sleep(waitTime);
// }
// }
@Test
@Order(3)
public void addUser() throws InterruptedException {
openTeamsPage();
Events.click(webDriver, By.xpath("//*[text()[contains(.,'" + teamDisplayName + "')]] "));
// Select the created listed team
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='checkboxAddUser']"));
Events.click(webDriver, By.cssSelector("[data-testid='AddUserSave']"));
Thread.sleep(waitTime);
}
}
@Test
@Order(4)

View File

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

View File

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

View File

@ -25,5 +25,7 @@ airflow users create \
--email spiderman@superhero.org \
--password admin
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