Skip to content

Commit

Permalink
update docker files and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hillalex committed Jun 23, 2022
1 parent 639119e commit 5af0d82
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 129 deletions.
31 changes: 25 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
FROM vimc/node-docker:master
FROM openjdk:11

# Install OpenJDK
RUN echo 'deb http://deb.debian.org/debian stretch-backports main' > /etc/apt/sources.list.d/stretch-backports.list
RUN apt-get update
RUN apt-get install -t stretch-backports -y \
openjdk-8-jdk
RUN rm /etc/apt/sources.list.d/stretch-backports.list
RUN apt-get install -y build-essential

# Install docker
RUN apt-get update
RUN apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
dirmngr \
apt-transport-https \
lsb-release \
gnupg \
ca-certificates

RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update
RUN apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin

RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get -y install nodejs

# Setup gradle
COPY src/gradlew /api/src/
Expand Down
4 changes: 2 additions & 2 deletions buildkite/common
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -ex

if [ "$BUILDKITE" = "true" ]; then
if [ -n "${BUILDKITE-}" ]; then
GIT_ID=${BUILDKITE_COMMIT:0:7}
else
GIT_ID=$(git rev-parse --short=7 HEAD)
fi

if [ "$BUILDKITE" = "true" ]; then
if [ -n "${BUILDKITE-}" ]; then
GIT_BRANCH=$BUILDKITE_BRANCH
else
GIT_BRANCH=$(git symbolic-ref --short HEAD)
Expand Down
3 changes: 2 additions & 1 deletion customConfigTests.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ RUN apt-get update && apt-get install -yq \
libxtst6 \
ca-certificates \
fonts-liberation \
libappindicator1 \
libgbm1 \
#libappindicator1 \
libnss3 \
lsb-release \
xdg-utils \
Expand Down
2 changes: 1 addition & 1 deletion dist.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:8u121
FROM openjdk:11

RUN mkdir /static/public -p

Expand Down
6 changes: 3 additions & 3 deletions scripts/install-chromedriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4
# See https://chromedriver.chromium.org/downloads/version-selection
curl -sO https://chromedriver.storage.googleapis.com/$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$(google-chrome --product-version | cut -d. -f1-3))/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/bin/chromedriver
sudo chown root:root /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
mv chromedriver /usr/bin/chromedriver
chown root:root /usr/bin/chromedriver
chmod +x /usr/bin/chromedriver
13 changes: 13 additions & 0 deletions src/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions src/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ class ReportTests : CleanDatabaseTests()
@Test
fun `can get latest dates for selected reports`()
{
val now = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)

insertReport("test1", "v1", date = Timestamp.from(now.minusSeconds(60)))
insertReport("test1", "v2", date = Timestamp.from(now))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import org.vaccineimpact.orderlyweb.models.ReportRunWithDate

class ReportRunRepositoryTests : CleanDatabaseTests()
{
private val now = Instant.now()
private val now = Instant.ofEpochMilli(1655378424228)

private fun addTestReportRun(sut: OrderlyWebReportRunRepository)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import java.time.Instant

class WorkflowRunReportRepositoryTests : CleanDatabaseTests()
{
private val startTime = Instant.now()
private val startTime = Instant.ofEpochMilli(1655378424228)

@Before
fun createWorkflow()
Expand Down Expand Up @@ -154,12 +154,11 @@ class WorkflowRunReportRepositoryTests : CleanDatabaseTests()
@Test
fun `can get report run when date is not null`()
{
val now = Instant.now()
val sut = OrderlyWebWorkflowRunReportRepository()
insertWorkflowRunReport("test_wf_key", "report_with_date_key", "report_with_date_name",
mapOf(), now)
mapOf(), startTime)
val result = sut.getReportRun("report_with_date_key")
assertThat(result.date).isEqualTo(now)
assertThat(result.date).isEqualTo(startTime)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class WorkflowRunRepositoryTests : CleanDatabaseTests()
{
insertUser("[email protected]", "user.name")

val now = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)

val workflowRun = WorkflowRun(
"Interim report",
Expand Down Expand Up @@ -207,7 +207,7 @@ class WorkflowRunRepositoryTests : CleanDatabaseTests()
{
insertUser("[email protected]", "user.name")

val now = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)

val sut = OrderlyWebWorkflowRunRepository()
sut.addWorkflowRun(
Expand Down Expand Up @@ -239,7 +239,7 @@ class WorkflowRunRepositoryTests : CleanDatabaseTests()
{
insertUser("[email protected]", "user.name")

val now = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)

val sut = OrderlyWebWorkflowRunRepository()
sut.addWorkflowRun(
Expand Down Expand Up @@ -311,7 +311,7 @@ class WorkflowRunRepositoryTests : CleanDatabaseTests()
insertUser("[email protected]", "user.name")
insertUser("[email protected]", "user2.name")

val now = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)

val sut = OrderlyWebWorkflowRunRepository()
sut.addWorkflowRun(
Expand Down Expand Up @@ -355,7 +355,7 @@ class WorkflowRunRepositoryTests : CleanDatabaseTests()
insertUser("[email protected]", "user.name")
insertUser("[email protected]", "user2.name")

val now = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)

val sut = OrderlyWebWorkflowRunRepository()
sut.addWorkflowRun(
Expand Down Expand Up @@ -398,7 +398,7 @@ class WorkflowRunRepositoryTests : CleanDatabaseTests()
{
insertUser("[email protected]", "user.name")

val now = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)

val sut = OrderlyWebWorkflowRunRepository()
sut.addWorkflowRun(
Expand Down Expand Up @@ -441,7 +441,7 @@ class WorkflowRunRepositoryTests : CleanDatabaseTests()
{
insertUser("[email protected]", "user.name")

val now = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)

val sut = OrderlyWebWorkflowRunRepository()
sut.addWorkflowRun(
Expand Down Expand Up @@ -484,7 +484,7 @@ class WorkflowRunRepositoryTests : CleanDatabaseTests()
{
insertUser("[email protected]", "user.name")

val now = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)

val sut = OrderlyWebWorkflowRunRepository()

Expand Down Expand Up @@ -525,7 +525,7 @@ class WorkflowRunRepositoryTests : CleanDatabaseTests()
{
insertUser("[email protected]", "user.name")

val now = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)

val sut = OrderlyWebWorkflowRunRepository()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class ReportLogsTests : IntegrationTest()
val sessionCookie = webRequestHelper.webLoginWithMontagu(permissions)
val contentType = ContentTypes.json

val now = Instant.now()
val now2 = Instant.now()
val now = Instant.ofEpochMilli(1655378424228)
val now2 = Instant.ofEpochMilli(1655378424229)

OrderlyWebReportRunRepository().addReportRun(
"key1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class WorkflowRunTests : IntegrationTest()
val name = "Interim report"
val key = "adventurous_aardvark"
val email = "[email protected]"
val date = Instant.now()
val date = Instant.ofEpochMilli(1655378424228)
val runWorkflowReport = listOf(
WorkflowRunReport(
"adventurous_aardvark",
Expand Down
Loading

0 comments on commit 5af0d82

Please sign in to comment.