Skip to content

Bump postman-collection to 5.0.0 #788

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

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/ci-install.sh
21 changes: 16 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,29 @@ on:
jobs:
Unit-Tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
max-parallel: 10
matrix:
node-version: [ 18.x, 20.x ]
language-variant: [ 'csharp-httpclient', 'csharp-restsharp', 'curl', 'dart-dio', 'dart-http', 'golang', 'http',
'java-okhttp', 'java-unirest', 'js-fetch', 'js-jquery', 'js-xhr', 'kotlin-okhttp', 'libcurl',
'nodejs-axios', 'nodejs-native', 'nodejs-request', 'nodejs-unirest', 'objective-c', 'ocaml-cohttp',
'php-curl', 'php-guzzle', 'php-httprequest2', 'php-pecl-http', 'powershell-restmethod',
'python-http.client', 'python-requests', 'r-httr', 'r-rcurl', 'ruby', 'rust-reqwest',
'shell-httpie', 'shell-wget', 'swift' ]
steps:
- name: Get Code
uses: actions/checkout@v3
- name: Setup Node JS
- name: Use Node JS ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install system dependencies
run: npm run cirequirements
node-version: ${{ matrix.node-version }}
- name: Install package dependencies
run: npm install
- name: Install system dependencies
run: npm run cirequirements ${{ matrix.language-variant }}
- name: Install dependencies for individual codegens
run: npm run deepinstall dev
- name: Run tests
run: npm run test
run: npm run test ${{ matrix.language-variant }}
15 changes: 15 additions & 0 deletions codegens/csharp-httpclient/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -ev; # stop on error

sudo apt-get update
echo "Installing dependencies required for tests in codegens/csharp-httpclient"
# Install latest .net6.0 sdk
pushd ./codegens/csharp-httpclient &>/dev/null;
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-6.0
dotnet new console -o testProject -f net6.0
# no extra packages needed
popd &>/dev/null;
18 changes: 18 additions & 0 deletions codegens/csharp-restsharp/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -ev; # stop on error

sudo apt-get update
echo "Installing dependencies required for tests in codegens/csharp-restsharp"
pushd ./codegens/csharp-restsharp &>/dev/null;
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-6.0
dotnet new console -o testProject -f net6.0
pushd ./testProject &>/dev/null;
dotnet add package RestSharp --version 112.0.0
popd &>/dev/null;
popd &>/dev/null;

sudo apt-get install -y mono-complete
5 changes: 5 additions & 0 deletions codegens/curl/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing curl"
sudo apt-get install -y curl
16 changes: 16 additions & 0 deletions codegens/dart-dio/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing dependencies required for tests in codegens/dart-dio"
pushd ./codegens/dart-dio &>/dev/null;
wget -q https://storage.googleapis.com/dart-archive/channels/stable/release/3.0.4/linux_packages/dart_3.0.4-1_amd64.deb
sudo dpkg -i dart_3.0.4-1_amd64.deb
echo '''name: test
version: 1.0.0
environment:
sdk: ^3.0.3
dependencies:
dio: ^5.2.0
''' > pubspec.yaml
dart pub get
popd &>/dev/null;
16 changes: 16 additions & 0 deletions codegens/dart-http/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing dependencies required for tests in codegens/dart-http"
pushd ./codegens/dart-http &>/dev/null;
wget -q https://storage.googleapis.com/dart-archive/channels/stable/release/3.0.4/linux_packages/dart_3.0.4-1_amd64.deb
sudo dpkg -i dart_3.0.4-1_amd64.deb
echo '''name: test
version: 1.0.0
environment:
sdk: ^3.0.3
dependencies:
http: ^1.0.0
''' > pubspec.yaml
dart pub get
popd &>/dev/null;
11 changes: 11 additions & 0 deletions codegens/java-okhttp/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing dependencies required for tests in codegens/java-okhttp"
pushd ./codegens/java-okhttp &>/dev/null;
sudo add-apt-repository ppa:openjdk-r/ppa -y
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update
sudo apt-get install -y openjdk-8-jdk
unzip test/unit/fixtures/dependencies.zip
popd &>/dev/null;
7 changes: 7 additions & 0 deletions codegens/java-unirest/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing dependencies required for tests in codegens/java-unirest"
pushd ./codegens/java-unirest &>/dev/null;
unzip test/unit/fixtures/dependencies.zip
popd &>/dev/null;
73 changes: 40 additions & 33 deletions codegens/js-fetch/npm-shrinkwrap.json

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

5 changes: 3 additions & 2 deletions codegens/js-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"homepage": "https://github.com/postmanlabs/code-generators/tree/master/codegens/js-fetch",
"dependencies": {},
"devDependencies": {
"form-data": "2.5.1",
"node-fetch": "2.6.7"
"formdata-node": "6.0.3",
"node-fetch2": "npm:[email protected]",
"node-fetch": "3.3.2"
},
"engines": {
"node": ">=8"
Expand Down
26 changes: 20 additions & 6 deletions codegens/js-fetch/test/newman/newman.test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
var runNewmanTest = require('../../../../test/codegen/newman/newmanTestUtil').runNewmanTest,
convert = require('../../lib/index').convert;
convert = require('../../lib/index').convert,
NODE_VERSION = process.versions.node.split('.')[0];

describe('Convert for different types of request', function () {
var testSnippet = 'var fetch = require(\'node-fetch\'),\nFormData = require(\'form-data\'),\n',
testConfig = {
var testConfig = {
compileScript: null,
runScript: 'node snippet.js',
fileName: 'snippet.js',
skipCollections: ['formdataFileCollection']
},
options = {
multiLine: true
};
testSnippet += 'Headers = require(\'node-fetch\').Headers,\n';
testSnippet += 'URLSearchParams = require(\'url\').URLSearchParams;\n\n';
},
testSnippet;

if (NODE_VERSION < 21) {
testSnippet = 'var fetch = require(\'node-fetch2\');\n';
}
else {
testSnippet = 'var fetch = (...args) => import(\'node-fetch\').then(({default: fetch}) => fetch(...args));';
}

if (NODE_VERSION < 21) {
// Newer node versions ship with built-in FormData, Headers and URLSearchParams class
testSnippet += '\nvar FormData = require(\'formdata-node\').FormData,\n';
testSnippet += 'Headers = require(\'node-fetch2\').Headers,\n';
testSnippet += 'URLSearchParams = require(\'url\').URLSearchParams;\n\n';
}

testConfig.headerSnippet = testSnippet;
runNewmanTest(convert, options, testConfig);
});
12 changes: 12 additions & 0 deletions codegens/kotlin-okhttp/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing dependencies required for tests in codegens/kotlin-okhttp"
pushd ./codegens/kotlin-okhttp &>/dev/null;
sudo add-apt-repository ppa:openjdk-r/ppa -y
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update
sudo apt-get install -y openjdk-8-jdk
sudo snap install --classic kotlin
unzip test/unit/fixtures/dependencies.zip
popd &>/dev/null;
7 changes: 7 additions & 0 deletions codegens/libcurl/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -ev; # stop on error

sudo apt-get update

echo "Installing dependencies required for tests in codegens/libcurl"
sudo apt-get install libcurl4-gnutls-dev
4 changes: 2 additions & 2 deletions codegens/nodejs-axios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"lodash": "4.17.21"
},
"devDependencies": {
"axios": "1.3.4",
"form-data": "3.0.0",
"axios": "1.7.9",
"form-data": "4.0.2",
"qs": "6.9.2"
},
"engines": {
Expand Down
9 changes: 9 additions & 0 deletions codegens/php-guzzle/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing dependencies required for tests in codegens/php-guzzle"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/bin/composer
composer global require guzzlehttp/guzzle:7.4.1
5 changes: 5 additions & 0 deletions codegens/php-httprequest2/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing dependencies required for tests in codegens/php-httprequest2"
pear install HTTP_Request2-2.3.0
5 changes: 5 additions & 0 deletions codegens/powershell-restmethod/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing Powershell"
sudo apt-get install powershell -y
9 changes: 9 additions & 0 deletions codegens/r-httr/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing dependencies required for tests in codegens/r-httr"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
sudo apt-get update
sudo apt-get install r-base libcurl4-gnutls-dev
sudo R --vanilla -e 'install.packages("httr", version="1.4.2", repos="http://cran.us.r-project.org")'
9 changes: 9 additions & 0 deletions codegens/r-rcurl/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing dependencies required for tests in codegens/r-httr"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
sudo apt-get update
sudo apt-get install r-base libcurl4-gnutls-dev
sudo R --vanilla -e 'install.packages("RCurl", version="1.98.1.6", repos="http://cran.us.r-project.org")'
21 changes: 21 additions & 0 deletions codegens/rust-reqwest/test/ci-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -ev; # stop on error

echo "Installing Rust"
sudo apt-get install -y build-essential pkg-config libssl-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
pushd ./codegens/rust-reqwest &>/dev/null;
echo '''[package]
name = "rust_reqwest_codegen"
version = "0.0.1"
edition = "2021"

[dependencies]
reqwest = { version = "0.11.14", features = ["json", "multipart"] }
tokio = { version = "1.26.0", features = ["full"] }
serde_json = { version = "1.0.94" }''' > Cargo.toml
mkdir src && echo '''fn main() {
println!("Hello, world!");
}''' > src/main.rs
cargo build
popd &>/dev/null;
Loading
Loading