Skip to content
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

[test] Replace argos-cli with @argos-ci/cli #34178

Merged
merged 7 commits into from Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -69,6 +69,7 @@
"validate-declarations": "babel-node --extensions \".ts\" scripts/validateTypescriptDeclarations.ts"
},
"devDependencies": {
"@argos-ci/core": "^0.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaldudak a new version 0.4.0 has been released with a better compression algorithm. Could you please upgrade?

Also we have a Discord, feel free to join! https://discord.gg/vMyXWVA8

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try it right away, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build still fails the same way. It doesn't seem to depend on the version of CLI/SDK used.

"@babel/cli": "^7.18.10",
"@babel/core": "^7.18.13",
"@babel/node": "^7.18.10",
Expand Down Expand Up @@ -105,7 +106,6 @@
"@types/yargs": "^17.0.11",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"argos-cli": "^0.4.0",
"babel-loader": "^8.2.5",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-macros": "^3.1.0",
Expand Down
40 changes: 16 additions & 24 deletions scripts/pushArgos.js
@@ -1,18 +1,8 @@
const util = require('util');
/* eslint-disable no-console */
const glob = require('fast-glob');
const fse = require('fs-extra');
const lodashChunk = require('lodash/chunk');
const childProcess = require('child_process');

const execFileNode = util.promisify(childProcess.execFile);

function execFile(command, args) {
return execFileNode(command, args, {
cwd: process.cwd(),
env: process.env,
encoding: 'utf-8',
});
}
const argos = require('@argos-ci/core');

const screenshotsBase = 'test/regressions/screenshots/chrome';
const screenshotsTmp = 'test/regressions/screenshots/argos';
Expand All @@ -37,18 +27,20 @@ async function run() {

for (let i = 0; i < chunks.length; i += 1) {
// eslint-disable-next-line no-await-in-loop
const argosResults = await execFile('argos', [
'upload',
`${screenshotsTmp}/${i}`,
'--token',
process.env.ARGOS_TOKEN,
'--batchCount',
chunks.length,
'--external-build-id',
process.env.CIRCLE_BUILD_NUM,
]);
// eslint-disable-next-line no-console -- pipe stdout
console.log(argosResults.stdout);
const result = await argos.upload({
root: `${screenshotsTmp}/${i}`,
commit: process.env.CIRCLE_SHA1,
branch: process.env.CIRCLE_BRANCH,
token: process.env.ARGOS_TOKEN,
parallel: {
total: chunks.length,
nonce: process.env.CIRCLE_BUILD_NUM,
},
});

console.log(
`Batch of ${chunks[i].length} screenshots uploaded. Build URL: ${result.build.url}`,
);
}
}

Expand Down