-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#1503] feat(IT): Gravitino web e2e test framework #1689
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest running web integration tests through special command arguments.
} | ||
|
||
@Override | ||
public void downloadWebDriver() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why aren't these downloads implemented with a separate script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better use JAVA method to download web browser driver.
if (!loaded) { | ||
fail(); | ||
} | ||
Dimension d = new Dimension(1920, 1080); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resolution here should not be hardcoded, and 1920*1080 is too large; many monitors are not that big. Let's ask @ch3yne to determine an appropriate size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1440*1080
or 1440*900
is usually enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ch3yne Thank you.
} | ||
|
||
if (!loaded) { | ||
fail(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give a clear error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, Please do not use Junit 4 API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted.
@Override | ||
public Boolean apply(WebDriver d) { | ||
String gravitinoVersion = d.findElement(By.id("gravitino_version")).getText(); | ||
String projectVersion = System.getenv("PROJECT_VERSION"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PROJECT_VERSION
should retrieved by gravitino server api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I worry Gravitino server failed to start.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Gravitino server failed to start. The tester also failed. So it does't matter
@@ -269,6 +271,7 @@ tasks.test { | |||
|
|||
// Default use MiniGravitino to run integration tests | |||
environment("GRAVITINO_ROOT_DIR", rootDir.path) | |||
environment("IT_PROJECT_DIR", buildDir.path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this environment? can we refer it from GRAVITINO_ROOT_DIR
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid splice integration-test module path, and hard code System.getenv("GRAVITINO_ROOT_DIR") + '\' + 'integration-test'
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class AbstractWebIT extends AbstractIT { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add some information about it and how we can use it.
Furthermore, add a description of the content subclass that extends it needs to add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE
this.chromeDriverBinName = ITUtils.joinPath("chromedriver_win32", "chromedriver.exe"); | ||
this.chromeBinName = ITUtils.joinPath("chrome-win", "chrome.exe"); | ||
} else { | ||
throw new RuntimeException("Unsupported OS"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add more information about the error message. like SystemUtils.OS_NAME
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
String chromeZipFile = "", chromeDriverZipFile = ""; | ||
if (SystemUtils.IS_OS_LINUX) { | ||
// https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F1000022%2Fchrome-linux.zip?generation=1651778257041732&alt=media | ||
chromeZipFile = "chrome-linux.zip"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think making chromeDownloadURL
and chromeDriverDownloadURL
a constant value can be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted your suggestion.
} | ||
|
||
if (!loaded) { | ||
fail(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, Please do not use Junit 4 API
@yuqi1129 Please help me review this PR again, Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What changes were proposed in this pull request?
Chrome
&Chrome Driver
into./intergration-test/build/chrome
directory. need to download about 150 MB zip file for the first time.Why are the changes needed?
Gravitino Web UI needs an E2E test to ensure Web UI usability.
Fix: #1503
Does this PR introduce any user-facing change?
N/A
How was this patch tested?
CI Passed