Skip to content

Commit

Permalink
Revert "Revert "Revert "Upgrade node for a version using openssl 3""" (
Browse files Browse the repository at this point in the history
…#1196)

Revert "Revert "Revert "Upgrade node for a version using openssl 3"" (#1195)"

This reverts commit 1c441a2.
  • Loading branch information
mipyykko authored May 26, 2023
1 parent 1c441a2 commit 72e4217
Show file tree
Hide file tree
Showing 8 changed files with 527 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ orbs:
executors:
node_postgres:
docker:
- image: cimg/node:18.16.0
- image: cimg/node:16.16.0
- image: cimg/postgres:14.6
environment:
POSTGRES_USER: root
Expand All @@ -24,7 +24,7 @@ executors:
jobs:
code_style:
docker:
- image: cimg/node:18.16.0
- image: cimg/node:16.16.0
steps:
- checkout
- node/install-packages
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ Install `docker-compose`, if not already installed.

## Development workflow

Current `node` version is `18.16.0`.

Run `npm ci` in the each of the root, backend and frontend directories to install dependencies.

Create separate shells for the database container, backend and frontend:
Expand Down
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.16.0-buster
FROM node:16.16.0-buster

RUN apt-get update \
&& apt-get install -yy build-essential libpng-dev postgresql-client libpq-dev redis-tools git jq \
Expand Down
42 changes: 14 additions & 28 deletions backend/graphql/Course/__test__/Course.mutations.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// import { createReadStream } from "fs"
import { createReadStream } from "fs"

import { gql } from "graphql-request"
import { mocked } from "jest-mock"
import { omit } from "lodash"
Expand Down Expand Up @@ -27,10 +28,6 @@ const anyPhoto = {
},
}

const noPhoto = {
photo: null,
}

describe("Course", () => {
describe("mutations", () => {
setupTMCWithDefaultFakeUsers()
Expand Down Expand Up @@ -63,8 +60,7 @@ describe("Course", () => {
inherit_settings_from: "00000000000000000000000000000002",
completions_handled_by: "00000000000000000000000000000002",
user_course_settings_visibilities: [{ language: "en_US" }],
// graphql-request removed support for file uploads
// new_photo: createReadStream(__dirname + "/../../../tests/data/image.gif"),
new_photo: createReadStream(__dirname + "/../../../tests/data/image.gif"),
language: "en",
tags: [
{
Expand Down Expand Up @@ -117,8 +113,7 @@ describe("Course", () => {
completions_handled_by: "00000000000000000000000000000001",
user_course_settings_visibilities: [{ language: "en_US" }],
photo: "00000000000000000000000000001101",
// graphql-request removed support for file uploads
// new_photo: createReadStream(__dirname + "/../../../tests/data/image.gif"),
new_photo: createReadStream(__dirname + "/../../../tests/data/image.gif"),
language: "en",
tags: [
{
Expand All @@ -128,11 +123,9 @@ describe("Course", () => {
})

const expectedAddedCourse = {
photo: null,
// graphql-request removed support for file uploads
/*photo: {
photo: {
...anyPhoto.photo,
}*/
},
}

const expectedUpdatedCourse = {
Expand Down Expand Up @@ -237,17 +230,14 @@ describe("Course", () => {
expect(createdCourse).toMatchStrippedSnapshot(
{
...(hasPhoto && {
// graphql-request removed support for file uploads
/*photo: {
photo: {
...anyPhoto.photo,
original: expect.stringContaining("image.gif"),
},*/
photo_id: null,
...noPhoto,
},
}),
},
{
idFields: ["id", "course_id" /*, "photo_id"*/].filter(
idFields: ["id", "course_id", "photo_id"].filter(
(f) => !omitIdFields.includes(f),
), //.filter(isNotNullOrUndefined),
excludePaths: ["tags.id"],
Expand Down Expand Up @@ -352,7 +342,6 @@ describe("Course", () => {
expect(res.updateCourse).toMatchStrippedSnapshot(
{
...expectedUpdatedCourse,
// graphql-request removed support for file uploads
photo: {
...anyPhoto.photo,
original: expect.stringContaining("original.gif"),
Expand Down Expand Up @@ -423,8 +412,7 @@ describe("Course", () => {
)
})

// graphql-request removed file upload support
it.skip("updates photo", async () => {
it("updates photo", async () => {
const res = await ctx.client.request<any>(
updateCourseMutation,
{
Expand All @@ -435,10 +423,9 @@ describe("Course", () => {

expect(res.updateCourse).toMatchStrippedSnapshot(
{
// graphql-request removed support for file uploads
/*photo: {
photo: {
...anyPhoto.photo,
},*/
},
},
{
excludePaths: ["id", "study_modules", "tags.id"],
Expand All @@ -462,10 +449,9 @@ describe("Course", () => {
expect(updatedCourse).toMatchStrippedSnapshot(
{
...anyPhoto,
// graphql-request removed support for file uploads
/*photo_id: expect.not.stringContaining(
photo_id: expect.not.stringContaining(
"00000000000000000000000000001101",
),*/
),
},
{
excludePaths: ["tags.id"],
Expand Down
Loading

0 comments on commit 72e4217

Please sign in to comment.