mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 08:22:12 +00:00
Databases and java pester tests (#2338)
* added mongodb postgres java tests * fixed 1.7 and 12 Java on Ubuntu 20 * several improvments * removed update-environment function * add etc-environment import * removed sourcing invoke-tests Co-authored-by: Leonid Lapshin <originalnoe-nazvanie@yandex.ru>
This commit is contained in:
30
images/linux/scripts/tests/Databases.Tests.ps1
Normal file
30
images/linux/scripts/tests/Databases.Tests.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
Describe "MongoDB" {
|
||||
It "<ToolName>" -TestCases @(
|
||||
@{ ToolName = "mongo" }
|
||||
@{ ToolName = "mongod" }
|
||||
) {
|
||||
"$ToolName --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "PostgreSQL" {
|
||||
|
||||
It "PostgreSQL Service" {
|
||||
"sudo systemctl start postgresql" | Should -ReturnZeroExitCode
|
||||
(Get-CommandResult "pg_isready").Output | Should -Be "/var/run/postgresql:5432 - accepting connections"
|
||||
"sudo systemctl stop postgresql" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "MySQL" {
|
||||
It "MySQL CLI" {
|
||||
"mysql -V" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "MySQL Service" {
|
||||
"sudo systemctl start mysql" | Should -ReturnZeroExitCode
|
||||
"sudo mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot" | Should -ReturnZeroExitCode
|
||||
"sudo mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot" | Should -ReturnZeroExitCode
|
||||
"sudo systemctl stop mysql" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user